From c7a557c43221c1fbad4117e63b6cd8c255ddc8f7 Mon Sep 17 00:00:00 2001 From: liu fengyun Date: Thu, 9 Feb 2017 17:24:47 +0100 Subject: add more debug files to the tests --- tests/debug/tailrec.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/debug/tailrec.scala (limited to 'tests/debug/tailrec.scala') diff --git a/tests/debug/tailrec.scala b/tests/debug/tailrec.scala new file mode 100644 index 000000000..f79514fa3 --- /dev/null +++ b/tests/debug/tailrec.scala @@ -0,0 +1,17 @@ +object Test { + def fact(x: Int): Int = { + if (x == 0) + 1 + else + x * fact(x - 1) // TODO: incorrect this line when x = 0 + } + + + def main(args: Array[String]): Unit = { + val a = 1 + 2 + val b = a * 9 // [break] [step: fact] + val c = fact(a) // [step: x == 0] [step: fact(x - 1)] [step: x == 0] [cont] + fact(0) // [break] [step: x == 0] [step: 1] [step: fact(x - 1)] [step: print] + print(c) // [cont] + } +} \ No newline at end of file -- cgit v1.2.3