File tree 2 files changed +5
-5
lines changed
src/test/scala/scala/async
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,14 @@ class FutureSpec {
95
95
val a = await(future0.mapTo[Int ]) // returns 5
96
96
val b = await(asyncInt(a)) // returns "10"
97
97
val c = await(asyncInt(7 )) // returns "14"
98
- b + " - " + c
98
+ s " $b - $c "
99
99
}
100
100
101
101
val future2 = async {
102
102
val a = await(future0.mapTo[Int ])
103
103
val b = await((Future { (a * 2 ).toString }).mapTo[Int ])
104
104
val c = await(Future { (7 * 2 ).toString })
105
- b + " - " + c
105
+ s " $b - $c "
106
106
}
107
107
108
108
Await .result(future1, defaultTimeout) mustBe (" 10-14" )
@@ -123,13 +123,13 @@ class FutureSpec {
123
123
Res (a : Int ) <- asyncReq(Req (" Hello" ))
124
124
Res (b : String ) <- asyncReq(Req (a))
125
125
Res (c : String ) <- asyncReq(Req (7 ))
126
- } yield b + " - " + c
126
+ } yield s " $b - $c "
127
127
128
128
val future2 = for {
129
129
Res (a : Int ) <- asyncReq(Req (" Hello" ))
130
130
Res (b : Int ) <- asyncReq(Req (a))
131
131
Res (c : Int ) <- asyncReq(Req (7 ))
132
- } yield b + " - " + c
132
+ } yield s " $b - $c "
133
133
134
134
Await .result(future1, defaultTimeout) mustBe (" 10-14" )
135
135
intercept[NoSuchElementException ] { Await .result(future2, defaultTimeout) }
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ object TestUtil {
59
59
}
60
60
61
61
implicit class objectops (obj : Any ) {
62
- def mustBe (other : Any ): Unit = assert(obj == other, obj + " is not " + other)
62
+ def mustBe (other : Any ): Unit = assert(obj == other, s " $ obj is not $ other" )
63
63
64
64
def mustEqual (other : Any ): Unit = mustBe(other)
65
65
}
You can’t perform that action at this time.
0 commit comments