Skip to content

Commit 213a3fd

Browse files
committed
Use custom print as a workaround for ScalaJS tests
1 parent 867fb35 commit 213a3fd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/run/better-fors-map-elim.scala

+10-4
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,38 @@ object Test extends App {
2727

2828
import myOption.*
2929

30+
def portablePrintMyOption(opt: MyOption[Any]): Unit =
31+
if opt == MySome(()) then
32+
println("MySome(())")
33+
else
34+
println(opt)
35+
3036
val z = for {
3137
a <- MyOption(1)
3238
b <- MyOption(())
3339
} yield ()
3440

35-
println(z)
41+
portablePrintMyOption(z)
3642

3743
val z2 = for {
3844
a <- MyOption(1)
3945
b <- MyOption(2)
4046
} yield b
4147

42-
println(z2)
48+
portablePrintMyOption(z2)
4349

4450
val z3 = for {
4551
a <- MyOption(1)
4652
(b, c) <- MyOption((2, 3))
4753
} yield (b, c)
4854

49-
println(z3)
55+
portablePrintMyOption(z3)
5056

5157
val z4 = for {
5258
a <- MyOption(1)
5359
(b, (c, d)) <- MyOption((2, (3, 4)))
5460
} yield (b, (c, d))
5561

56-
println(z4)
62+
portablePrintMyOption(z4)
5763

5864
}

0 commit comments

Comments
 (0)