Suffix handling unit test... it passes so it must be bug free!

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5324 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Bruno Garcia
2008-08-15 21:50:22 +00:00
parent 29204b385d
commit c49f655e7b
2 changed files with 20 additions and 0 deletions
+7
View File
@@ -6,3 +6,10 @@
m.foo = Foo arg one is '{0}' and two is '{1}'.
m.biff = Biff arg one is '{0}' and two is '{1}'.
m.meta = Meta arg one is '{0}' and two is '{1}'.
m.sheep = Don't suffix me
m.sheep.0 = No sheep
m.sheep.1 = One sheep
m.sheep.n = {0} sheeps
m.coord = {0}x{1}
@@ -58,6 +58,19 @@ public class MessageBundleTest extends TestCase
fail("xlate failed: " + output);
}
// Counting sheep
assertEquals("No sheep",
bundle.xlate(MessageBundle.compose("m.sheep", MessageBundle.taint(0))));
assertEquals("One sheep",
bundle.xlate(MessageBundle.compose("m.sheep", MessageBundle.taint(1))));
assertEquals("666 sheeps",
bundle.xlate(MessageBundle.compose("m.sheep", MessageBundle.taint("666"))));
assertEquals("Don't suffix me",
bundle.xlate(MessageBundle.compose("m.sheep", MessageBundle.taint("zzz"))));
assertEquals("7x12", bundle.xlate(MessageBundle.compose("m.coord",
MessageBundle.taint(7), MessageBundle.taint(12))));
} catch (Exception e) {
fail("Test failed: " + e);
}