Skip to content

Commit ded33b0

Browse files
committed
Unit tests for Issue #73
1 parent e02c2be commit ded33b0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

shared/src/test/scala/scala/xml/UtilityTest.scala

+24
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,28 @@ class UtilityTest {
194194
).toMap.withDefault {
195195
key: Char => key.toString
196196
}
197+
198+
def issue73StartsWithAndEndsWithWSInFirst: Unit = {
199+
val x = <div>{Text(" My name is ")}{Text("Harry")}</div>
200+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
201+
}
202+
203+
@Test
204+
def issue73EndsWithWSInLast: Unit = {
205+
val x = <div>{Text("My name is ")}{Text("Harry ")}</div>
206+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
207+
}
208+
209+
@Test
210+
def issue73HasWSInMiddle: Unit = {
211+
val x = <div>{Text("My name is")}{Text(" ")}{Text("Harry")}</div>
212+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
213+
}
214+
215+
@Test
216+
def issue73HasWSEverywhere: Unit = {
217+
val x = <div>{Text(" My name ")}{Text(" is ")}{Text(" Harry ")}</div>
218+
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
219+
}
220+
197221
}

0 commit comments

Comments
 (0)