aboutsummaryrefslogblamecommitdiff
path: root/tests/pending/run/ctries-old/main.scala
blob: 09401a371c0a4fa593288a61e9413dbde54f1bfa (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                              
                                         









                            

                                                                                                      
 

                                                                              




                          
                                                                                 
















                                                                                                         
@deprecated("Suppress warnings", since="2.11")
object Test {

  def main(args: Array[String]): Unit = {
    ConcurrentMapSpec.test()
    IteratorSpec.test()
    LNodeSpec.test()
    SnapshotSpec.test()
  }



trait Spec {

  implicit def implicitously: languageFeature.implicitConversions = scala.language.implicitConversions
  implicit def reflectively : languageFeature.reflectiveCalls = scala.language.reflectiveCalls

  implicit def str2ops(s: String): AnyRef{def in[U](body: => U): Unit} = new {
    def in[U](body: =>U): Unit = {
      // just execute body
      body
    }
  }

  implicit def any2ops(a: Any): AnyRef{def shouldEqual(other: Any): Unit} = new {
    def shouldEqual(other: Any) = assert(a == other)
  }

  def evaluating[U](body: =>U) = new {
    def shouldProduce[T <: Throwable: ClassManifest]() = {
      var produced = false
      try body
      catch {
        case e: Throwable => if (e.getClass == implicitly[ClassManifest[T]].runtimeClass) produced = true
      } finally {
        assert(produced, "Did not produce exception of type: " + implicitly[ClassManifest[T]])
      }
    }
  }

}
}