| version 1.1.1.4, 1999/09/30 13:57:07 |
version 1.1.1.5, 1999/10/06 13:08:31 |
|
|
|
|
| String[] result = Link.split(test); |
String[] result = Link.split(test); |
| |
|
| assert( ! Link.isLink(result[0]) ); |
assert( ! Link.isLink(result[0]) ); |
| assert( ! Link.isLink(result[1]) ); |
assert( Link.isLink(result[1]) ); |
| assert( Link.isLink(result[2]) ); |
|
| |
|
| } |
} |
| |
|
| |
|
|
|
|
|
| } |
} |
| |
|
| |
|
| // Check we can split a string into link strings and nonlink strings |
// Check that links render themselves as expected |
| public void testSplit() { |
public void testLinkRenderingEmptyLink() { |
| |
String test = "I hate __Microsoft_."; |
| |
assert("This is a known failure, to fix next week", Link.renderWholeString(test, "").equals(test)); |
| |
} |
| |
// Check that links render themselves as expected |
| |
public void testLinkRenderingWithMalformedLink() { |
| |
|
| String test = "I hate _Microsoft_"; |
String test = "I hate _Microsoft bad link."; |
| |
|
| String[] result = Link.split(test); |
assert("Broken link should result in unchanged string", |
| |
Link.renderWholeString(test,"").equals(test)); |
| |
} |
| |
|
| assert( result[0].equals("I") ); |
|
| assert( result[1].equals("hate") ); |
|
| assert( result[2].equals("_Microsoft_") ); |
|
| |
|
| assert("When we call split with null, return empty array", Link.split(null).length == 0 ); |
// Check that links render themselves as expected |
| |
public void testLinkRenderingWithPunctuation() { |
| |
|
| |
String test = "I hate _Microsoft_."; |
| |
|
| |
assert("Punctuation should be handled", |
| |
Link.renderWholeString(test,"").equals("I hate <a href=\"Microsoft\">Microsoft</a>.")); |
| } |
} |
| |
|
| |
|
| |
// Check we can split a string into link strings and nonlink strings |
| |
public void testSplit() { |
| |
String test = "I hate _Microsoft_"; |
| |
String[] result = Link.split(test); |
| |
assert(result[0].equals("I hate ")); |
| |
assert(result[1].equals("_Microsoft_")); |
| |
} |
| } |
} |