Skip to content

Commit cb5a295

Browse files
committed
Unit tests for Issue #73
1 parent 5b53104 commit cb5a295

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: src/test/scala/scala/xml/UtilityTest.scala

+24
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,28 @@ class UtilityTest {
5454
</hi>.hashCode // Bug #777
5555
}
5656

57+
@Test
58+
def issue73StartsWithAndEndsWithWSInFirst: Unit = {
59+
val x = <div>{Text(" My name is ")}{Text("Harry")}</div>
60+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
61+
}
62+
63+
@Test
64+
def issue73EndsWithWSInLast: Unit = {
65+
val x = <div>{Text("My name is ")}{Text("Harry ")}</div>
66+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
67+
}
68+
69+
@Test
70+
def issue73HasWSInMiddle: Unit = {
71+
val x = <div>{Text("My name is")}{Text(" ")}{Text("Harry")}</div>
72+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
73+
}
74+
75+
@Test
76+
def issue73HasWSEverywhere: Unit = {
77+
val x = <div>{Text(" My name ")}{Text(" is ")}{Text(" Harry ")}</div>
78+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
79+
}
80+
5781
}

0 commit comments

Comments
 (0)