From 8814de2aa0fc14df0785dfa9ee96d154c32e5646 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 28 Aug 2009 11:25:43 +0000 Subject: Fix and test case for #2276. --- test/files/run/bug2276.check | 8 ++++++++ test/files/run/bug2276.scala | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 test/files/run/bug2276.check create mode 100644 test/files/run/bug2276.scala (limited to 'test/files') diff --git a/test/files/run/bug2276.check b/test/files/run/bug2276.check new file mode 100644 index 0000000000..95f51c8e29 --- /dev/null +++ b/test/files/run/bug2276.check @@ -0,0 +1,8 @@ + + + 2 + + + 2 + + diff --git a/test/files/run/bug2276.scala b/test/files/run/bug2276.scala new file mode 100644 index 0000000000..815e88e429 --- /dev/null +++ b/test/files/run/bug2276.scala @@ -0,0 +1,24 @@ +import scala.xml._ +import scala.xml.transform._ + +object Test extends Application { + val inputXml : Node = + + + 1 + + + 1 + + + + object t1 extends RewriteRule { + override def transform(n: Node): Seq[Node] = n match { + case {x} if x.toString.toInt < 4 => {x.toString.toInt+1} + case other => other + } + } + + val ruleTransformer = new RuleTransformer(t1) + println(ruleTransformer(inputXml)) +} \ No newline at end of file -- cgit v1.2.3