-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove some debug, add more test-cases
- Loading branch information
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
compiler-plugin/testdata/set13TestCases/m7_min1/TestFutureRangeWithFilterShift.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|