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:
@@ -6,3 +6,10 @@
|
|||||||
m.foo = Foo arg one is '{0}' and two is '{1}'.
|
m.foo = Foo arg one is '{0}' and two is '{1}'.
|
||||||
m.biff = Biff 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.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);
|
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) {
|
} catch (Exception e) {
|
||||||
fail("Test failed: " + e);
|
fail("Test failed: " + e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user