Skip to content

Commit

Permalink
more loom tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rssh committed Sep 28, 2023
1 parent ef76d2e commit 022289e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 13 additions & 1 deletion compiler-plugin/src/test/scala/cc/Test18Loom.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,29 @@ class Test18Loom {
DotcInvocations.compileAndRunJunitTestAfterDependency(dirname, testClassName, invocationArgs, Test18Loom.commonDependency)
}


@Test
def testHOFunctionArg() = {
compileAndRunTestAfterCommon("testdata/set18loom/m1", "cpsloomtest.TestHOFunctionArgLoomTransform",
DotcInvocationArgs(checkAll = true,
extraDotcArgs = List(
"-Vprint:rssh.cps"
// "-Vprint:rssh.cps"
)
)
)
}


@Test
def testTwiceWithFuture() = {
compileAndRunTestAfterCommon("testdata/set18loom/m2", "cpsloomtest.TestTwice",
DotcInvocationArgs(checkAll = true,
extraDotcArgs = List(
// "-Vprint:rssh.cps"
)
)
)
}

}

Expand Down
5 changes: 3 additions & 2 deletions jvm-loom-addon/src/test/scala/cpsloomtest/TestTwice.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class TestTwice {
def testAwaitInTwiceArg(): Unit = {

val f = async[Future]{
twice{ (x: Int) =>
await(Future.successful(x+1))
twice { (x: Int) =>
await(Future.successful(x + 1))
}(1)
}
val r = Await.result(f, 1.second)
assert(r == 3)

}

}

0 comments on commit 022289e

Please sign in to comment.