Skip to content

Commit

Permalink
remove some debug, add more test-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rssh committed May 11, 2024
1 parent cb17d31 commit d909b30
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
4 changes: 0 additions & 4 deletions compiler-plugin/src/test/scala/cc/Test15PE.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class Test15PE {


@Test
@Ignore
def testFizzBuzz() = {
compileAndRunTestAfterCommon("testdata/set15pe/m1", "cps.pe.TestFizzBuzz",
DotcInvocationArgs(checkAll = true,
Expand All @@ -29,7 +28,6 @@ class Test15PE {


@Test
@Ignore
def testFizzBuzzLocalDirectRef() = {
compileAndRunTestAfterCommon("testdata/set15pe/m2", "cps.pe.TestFizzBuzz",
DotcInvocationArgs(checkAll = true,
Expand All @@ -42,7 +40,6 @@ class Test15PE {


@Test
@Ignore
def testUseResourceM3() = {
compileAndRunTestAfterCommon("testdata/set15pe/m3", "cps.pe.TestUseResource",
DotcInvocationArgs(checkAll = true,
Expand All @@ -55,7 +52,6 @@ class Test15PE {


@Test
@Ignore
def testUseResourceM4() = {
compileAndRunTestAfterCommon("testdata/set15pe/m4", "cps.pe.TestUseResourceFromPlugin",
DotcInvocationArgs(checkAll = true,
Expand Down
4 changes: 3 additions & 1 deletion compiler-plugin/src/test/scala/cc/Test21Abstract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Test21Abstract {
DotcInvocations.compileAndRunFilesInDirAndCheckResult(
"testdata/set21abstract/m2",
"m2.Main",
invocationArgs = DotcInvocationArgs(silent=false, extraDotcArgs = List("-Vprint:erasure,rssh.cps"))
invocationArgs = DotcInvocationArgs(silent=false,
//extraDotcArgs = List("-Vprint:erasure,rssh.cps")
)
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package cps

import org.junit.{Test,Ignore}
import org.junit.Assert.*

import scala.quoted.*
import scala.util.*
import scala.util.*
import scala.concurrent.*
import scala.concurrent.duration.*
import scala.concurrent.ExecutionContext.Implicits.global


import cps.monads.given
import cps.plugin.annotation.*
import cps.macros.flags.UseCompilerPlugin
given UseCompilerPlugin.type = UseCompilerPlugin



class TestFutureRangeWithFilterShiftM7min1:


/**
* we need special handling for withFilter.
**/
@Test def testWithFilterForeachWrapper() =
//implicit val printCode = cps.macroFlags.PrintCode
//implicit val debugLevel = cps.macroFlags.DebugLevel(20)
val c = async[Future]{
var s = 0
for(i <- 1 to 4 if i%2 == 1) {
s += await(Future successful 3) + i
}
s
assert(s == 10)
}
Await.ready(c, 1.second)


0 comments on commit d909b30

Please sign in to comment.