Skip to content

Commit

Permalink
Unit tests for Issue #73
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgeCaseBerg committed Feb 11, 2017
1 parent 9cb7579 commit 990b379
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions shared/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 990b379

Please sign in to comment.