use of android.icu.text.SimpleFormatter in project j2objc by google.
the class SimpleFormatterTest method TestFormatReplaceNoOptimizationLeadingArgumentUsedTwice.
@Test
public void TestFormatReplaceNoOptimizationLeadingArgumentUsedTwice() {
SimpleFormatter fmt = SimpleFormatter.compile("{2}, {0}, {1} and {3} {2}");
StringBuilder result = new StringBuilder("original");
int[] offsets = new int[4];
assertEquals("", "original, freddy, frog and by original", fmt.formatAndReplace(result, offsets, "freddy", "frog", result, "by").toString());
int[] expectedOffsets = { 10, 18, 30, 27 };
verifyOffsets(expectedOffsets, offsets);
}
use of android.icu.text.SimpleFormatter in project j2objc by google.
the class SimpleFormatterTest method TestFormatReplaceNoOptimizationNoOffsets.
@Test
public void TestFormatReplaceNoOptimizationNoOffsets() {
SimpleFormatter fmt = SimpleFormatter.compile("Arguments {0} and {1}");
StringBuilder result = new StringBuilder("previous:");
assertEquals("", "Arguments previous: and frog", fmt.formatAndReplace(result, null, result, "frog").toString());
}
Aggregations