Skip to content

Commit

Permalink
Unit tests for Issue scala#73
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgeCaseBerg committed Oct 6, 2016
1 parent 5b53104 commit cb5a295
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/scala/scala/xml/UtilityTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,28 @@ class UtilityTest {
</hi>.hashCode // Bug #777
}

@Test
def issue73StartsWithAndEndsWithWSInFirst: Unit = {
val x = <div>{Text(" My name is ")}{Text("Harry")}</div>
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
}

@Test
def issue73EndsWithWSInLast: Unit = {
val x = <div>{Text("My name is ")}{Text("Harry ")}</div>
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
}

@Test
def issue73HasWSInMiddle: Unit = {
val x = <div>{Text("My name is")}{Text(" ")}{Text("Harry")}</div>
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
}

@Test
def issue73HasWSEverywhere: Unit = {
val x = <div>{Text(" My name ")}{Text(" is ")}{Text(" Harry ")}</div>
assertEquals(<div>My name is Harry</div>, Utility.trim(x))
}

}

0 comments on commit cb5a295

Please sign in to comment.