Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added spec for issue #75

  • Loading branch information...
commit 5ef90584fa3bc10fd72013f79fa92b4dc3b2be35 1 parent 5e5bd3f
@djspiewak authored
View
1,410 src/test/resources/jira-rss-derby-project.xml
1,410 additions, 0 deletions not shown
View
12 src/test/scala/com/codecommit/antixml/XMLSpecs.scala
@@ -28,6 +28,8 @@
package com.codecommit.antixml
+import java.util.Scanner
+
import org.specs2.execute.Pending
import org.specs2.mutable._
@@ -63,7 +65,7 @@ class XMLSpecs extends Specification {
val ns = "urn:my-urn:quux";
fromString("<my:test xmlns:my='urn:my-urn:quux'/>") mustEqual Elem(Some("my"), "test", Attributes(), Map("my" -> ns), Group[Node]())
}
-
+
"parse prefixes" in {
fromString("<my:test xmlns:my='urn:my-urn:quux'></my:test>").name mustEqual "test"
}
@@ -83,5 +85,13 @@ class XMLSpecs extends Specification {
}
}
+ "fromString" should {
+ "parse a complex document without stack overflow" in {
+ val stream = getClass.getClassLoader.getResourceAsStream("jira-rss-derby-project.xml")
+ val string = new Scanner(stream, "UTF-8").useDelimiter("\\A").next
+ XML.fromString(string) must not(throwA[StackOverflowError])
+ }
+ }
+
def elem(name: QName, children: Node*) = Elem(name.prefix, name.name, Attributes(), Map(), Group(children: _*))
}
Please sign in to comment.
Something went wrong with that request. Please try again.