forked from Archives/Athou_commafeed
add tests for FeedUtils.removeTrailingSlash()
This commit is contained in:
@@ -78,4 +78,19 @@ public class FeedUtilsTest {
|
|||||||
String source = "<source>T´l´phone ′</source>";
|
String source = "<source>T´l´phone ′</source>";
|
||||||
Assert.assertEquals("<source>T´l´phone ′</source>", FeedUtils.replaceHtmlEntitiesWithNumericEntities(source));
|
Assert.assertEquals("<source>T´l´phone ′</source>", FeedUtils.replaceHtmlEntitiesWithNumericEntities(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRemoveTrailingSlash() {
|
||||||
|
final String url = "http://localhost/";
|
||||||
|
final String result = FeedUtils.removeTrailingSlash(url);
|
||||||
|
Assert.assertEquals("http://localhost", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRemoveTrailingSlash_lastSlashOnly() {
|
||||||
|
final String url = "http://localhost//";
|
||||||
|
final String result = FeedUtils.removeTrailingSlash(url);
|
||||||
|
Assert.assertEquals("http://localhost/", result);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user