Skip to content

Commit

Permalink
painfully workaround REPL class names
Browse files Browse the repository at this point in the history
  • Loading branch information
razie committed Sep 13, 2011
1 parent 1865eec commit cd849e9
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/test/scala/razie/scripster/test/ScalaDemoTest.scala
Expand Up @@ -68,12 +68,30 @@ class ScalaDemoTest extends MustMatchers {
Demo.add (1+2, 8/4)
}

@Test def interpretedShouldEqual3 = expect (true) {
// @Test def interpretedShouldEqual3 = expect (true) {
// // simple, one time, expression
// val ctx = ScalaScript.mkContext
// ScalaScript (Demo.demo).interactive (ctx)
// ScalaScript ("val x = add (1+2, 8/4)").eval (ctx)
// ScalaScript ("x == Num(5)").eval (ctx) getOrElse false
// }

val KK="""
import razie._
case class C4 { val c="c" }
case class C3 { val c=C4() }
case class C2 { val c=C3() }
case class C1 { val c=C2() }
val root=C1()
def xpl(path: String) = XP[Any](path) using BeanXpSolver xpl root
xpl ("/root/**/C4/c").size
"""

@Test def wellItFails = expect (1) {
// simple, one time, expression
val ctx = ScalaScript.mkContext
ScalaScript (Demo.demo).interactive (ctx)
ScalaScript ("val x = add (1+2, 8/4)").eval (ctx)
ScalaScript ("x == Num(5)").eval (ctx) getOrElse false
ScalaScript (KK).eval (ctx) getOrElse 0
}


}

0 comments on commit cd849e9

Please sign in to comment.