MCPcopy Create free account
hub / github.com/ReadyTalk/avian / main

Method main

test/MessageFormatTest.java:11–22  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9 }
10
11 public static void main(String[] args) {
12 assertEquals("Hi there", MessageFormat.format("Hi there", "a"));
13 assertEquals("Hi there", MessageFormat.format("Hi {0}here", "t"));
14 assertEquals("Hi a!a!a", MessageFormat.format("Hi {0}!{0}!{0}", "a"));
15 assertEquals("Hi There", MessageFormat.format("{1} {0}", "There", "Hi"));
16 assertEquals("6 There 4", MessageFormat.format("{1} {2} {0}", 4, 6, "There"));
17 assertEquals("Zero and {0} aren't the same", MessageFormat.format("{0} and '{0}' aren''t the same","Zero"));
18 assertEquals("There are six grapes", MessageFormat.format("There are {0} grapes", "six"));
19 assertEquals("3 + 2 = 5", MessageFormat.format("{2} + {1} = {0}", 5, 2, 3));
20 assertEquals("again and again and again", MessageFormat.format("{0} and {0} and {0}", "again"));
21 assertEquals("Joe's age is 30, not {0}", MessageFormat.format("Joe''s age is {0}, not '{0}'", 30));
22 }
23
24}

Callers

nothing calls this directly

Calls 2

assertEqualsMethod · 0.95
formatMethod · 0.95

Tested by

no test coverage detected