diff options
author | Paul Phillips <paulp@improving.org> | 2009-07-05 14:46:37 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-07-05 14:46:37 +0000 |
commit | 67881bbca054809bc97af17cce1134affa02398f (patch) | |
tree | d355ff34616800e72d919e6a60ab28657f1a262d /test | |
parent | e373d268a5a15daab4ee2aef8f45eccca908b026 (diff) | |
download | scala-67881bbca054809bc97af17cce1134affa02398f.tar.gz scala-67881bbca054809bc97af17cce1134affa02398f.tar.bz2 scala-67881bbca054809bc97af17cce1134affa02398f.zip |
Fixes and test cases for #2124 and #2125.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/bug2124.check | 1 | ||||
-rw-r--r-- | test/files/run/bug2124.scala | 25 | ||||
-rw-r--r-- | test/files/run/bug2125.check | 1 | ||||
-rw-r--r-- | test/files/run/bug2125.scala | 25 |
4 files changed, 52 insertions, 0 deletions
diff --git a/test/files/run/bug2124.check b/test/files/run/bug2124.check new file mode 100644 index 0000000000..2b8840209f --- /dev/null +++ b/test/files/run/bug2124.check @@ -0,0 +1 @@ +<p><lost></lost><q></q></p> diff --git a/test/files/run/bug2124.scala b/test/files/run/bug2124.scala new file mode 100644 index 0000000000..ae16e66706 --- /dev/null +++ b/test/files/run/bug2124.scala @@ -0,0 +1,25 @@ +import scala.xml._ + +import scala.xml.transform._ + +object Test { + val sampleXml = <p><lost/><t><s><r></r></s></t></p> + + def main(args: scala.Array[String]) { + + println(new RuleTransformer(new RewriteRule { + + override def transform(n: Node): NodeSeq = { + val result = n match { + case <t>{_*}</t> => <q/> + + case n => n + + } +// println ("Rewriting '" +n+ "' to: '" + result+ "'") + + result + } + }).transform(sampleXml)) + } +}
\ No newline at end of file diff --git a/test/files/run/bug2125.check b/test/files/run/bug2125.check new file mode 100644 index 0000000000..2b8840209f --- /dev/null +++ b/test/files/run/bug2125.check @@ -0,0 +1 @@ +<p><lost></lost><q></q></p> diff --git a/test/files/run/bug2125.scala b/test/files/run/bug2125.scala new file mode 100644 index 0000000000..053798e3db --- /dev/null +++ b/test/files/run/bug2125.scala @@ -0,0 +1,25 @@ +import scala.xml._ + +import scala.xml.transform._ + +object Test { + + val sampleXml = <xml:group><p><lost/><t><s><r></r></s></t></p></xml:group> + + def main(args: scala.Array[String]) { + println(new RuleTransformer(new RewriteRule { + + override def transform(n: Node): NodeSeq = { + + val result = n match { + + case <t>{_*}</t> => <q/> + + case n => n + } +// println ("Rewriting '" +n+ "' to: '" + result+ "'") + result + } + }).transform(sampleXml)) + } +}
\ No newline at end of file |