testing3/bf1b_test.scala
changeset 160 250e1d7df9ff
parent 153 316f9c6cc2ff
equal deleted inserted replaced
159:6ba27d7cf416 160:250e1d7df9ff
     1 
     1 
     2 import scala.concurrent._
     2 //import scala.concurrent._
     3 import scala.concurrent.duration._
     3 //import scala.concurrent.duration._
     4 import ExecutionContext.Implicits.global
     4 //import ExecutionContext.Implicits.global
     5 import scala.language.postfixOps 
     5 //import scala.language.postfixOps 
     6 import scala.language.reflectiveCalls
     6 //import scala.language.reflectiveCalls
     7 
     7 
     8 lazy val f = Future {
     8 //lazy val f = Future {
     9   import CW8b._
     9   import CW8b._
    10 
    10 
    11   assert(jumpRight("[******]***", 1, 0) == 8)
    11   assert(jumpRight("[******]***", 1, 0) == 8)
    12   assert(jumpRight("[**[*]*]***", 1, 0) == 8)
    12   assert(jumpRight("[**[*]*]***", 1, 0) == 8)
    13   assert(jumpRight("[**[*]*]***", 1, 0) == 8)  
    13   assert(jumpRight("[**[*]*]***", 1, 0) == 8)  
    14   assert(jumpRight("[**[***]***", 1, 0) == 11)
    14   assert(jumpRight("[**[***]***", 1, 0) == 11)
    15   assert(jumpRight("[*[][]*]***", 1, 0) == 8)
    15   assert(jumpRight("[*[][]*]***", 1, 0) == 8)
    16   assert(jumpLeft("[******]***", 6, 0) == 1)
    16   assert(jumpLeft("[******]***", 6, 0) == 1)
    17   assert(jumpLeft("[******]***", 7, 0) == -1)
    17   assert(jumpLeft("[******]***", 7, 0) == -1)
    18   assert(jumpLeft("[*[][]*]***", 6, 0) == 1)
    18   assert(jumpLeft("[*[][]*]***", 6, 0) == 1)
    19 }
    19 //}
    20 
    20 
    21 Await.result(f, 120 second)
    21 //Await.result(f, 120 second)