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 Apr 24, 2018
1 parent e02c2be commit ded33b0
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 @@ -194,4 +194,28 @@ class UtilityTest {
).toMap.withDefault {
key: Char => key.toString
}

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 ded33b0

Please sign in to comment.