File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,30 @@ class AttributeTest {
104104 assertEquals(NodeSeq .fromSeq(Seq (Text (" 1" ), Text (" 2" ))), (xml \\ " @bar" ))
105105 }
106106
107+ @ Test
108+ def attributeDescendantPathChildAttributes : Unit = {
109+ val xml = <a ><b bar =" 1" /><b bar =" 2" /></a >
110+ assertEquals(NodeSeq .fromSeq(Seq (Text (" 1" ), Text (" 2" ))), (xml \ " b" \\ " @bar" ))
111+ }
112+
113+ @ Test
114+ def attributeDescendantPathDescendantAttributes : Unit = {
115+ val xml = <a ><b bar =" 1" /><b bar =" 2" /></a >
116+ assertEquals(NodeSeq .fromSeq(Seq (Text (" 1" ), Text (" 2" ))), (xml \\ " b" \\ " @bar" ))
117+ }
118+
119+ @ Test
120+ def attributeChildDescendantPathDescendantAttributes : Unit = {
121+ val xml = <x ><a ><b bar =" 1" /><b bar =" 2" /></a ></x >
122+ assertEquals(NodeSeq .fromSeq(Seq (Text (" 1" ), Text (" 2" ))), (xml \ " a" \\ " @bar" ))
123+ }
124+
125+ @ Test
126+ def attributeDescendantDescendantPathDescendantAttributes : Unit = {
127+ val xml = <x ><a ><b bar =" 1" /><b bar =" 2" /></a ></x >
128+ assertEquals(NodeSeq .fromSeq(Seq (Text (" 1" ), Text (" 2" ))), (xml \\ " b" \\ " @bar" ))
129+ }
130+
107131 @ Test (expected= classOf [IllegalArgumentException ])
108132 def attributePathDescendantIllegalEmptyAttribute : Unit = {
109133 val xml = <foo />
You can’t perform that action at this time.
0 commit comments