Fixed #35. Added support for surround function

This commit is contained in:
Shekhar Gulati
2016-05-22 18:07:46 +05:30
parent c1b1a70eaa
commit 1b7c268bbe
2 changed files with 25 additions and 0 deletions
+9
View File
@@ -711,6 +711,15 @@ public class StrmanTest {
@Test
public void transliterate_shouldTransliterateTheText() throws Exception {
assertThat(transliterate("fóõ bár"), equalTo("foo bar"));
}
@Test
public void surround_shouldSurrondStringWithPrefixAndSuffix() throws Exception {
assertThat(surround("foo", "bar", null), equalTo("barfoobar"));
assertThat(surround("shekhar", "***", null), equalTo("***shekhar***"));
assertThat(surround("", ">", null), equalTo(">>"));
assertThat(surround("bar", "", null), equalTo("bar"));
assertThat(surround("f", null, null), equalTo("f"));
assertThat(surround("div", "<", ">"), equalTo("<div>"));
}
}