}
public void test(TestHarness harness)
{
harness.checkPoint("non-contextual");
NumericShaper nonc = NumericShaper.getShaper(NumericShaper.TIBETAN);
harness.check(! nonc.isContextual());
testOne(harness, "abc 0123", nonc,
"abc \u0f20\u0f21\u0f22\u0f23", -1);
testOne(harness, "abc 0123", nonc,
"abc \u0f20\u0f21\u0f22\u0f23", NumericShaper.BENGALI);
// Note that the JDK fails some of these, as ethiopic does not
// have a digit zero.
nonc = NumericShaper.getShaper(NumericShaper.ETHIOPIC);
testOne(harness, "abc 0123", nonc,
"abc 0\u1369\u136a\u136b", -1);
testOne(harness, "abc 0123", nonc,
"abc 0\u1369\u136a\u136b", NumericShaper.EASTERN_ARABIC);
harness.checkPoint("contextual");
NumericShaper contextualI
= NumericShaper.getContextualShaper(NumericShaper.KHMER
| NumericShaper.ETHIOPIC);
NumericShaper contextualE
= NumericShaper.getContextualShaper(NumericShaper.KHMER
| NumericShaper.ETHIOPIC,
NumericShaper.EUROPEAN);
harness.check(contextualE.equals(contextualI));
harness.check(contextualE.isContextual());
// Use built-in context.
testOne(harness, "45", contextualE, "45", -1);
// Explicit context.
testOne(harness, "45", contextualE, "\u17e4\u17e5", NumericShaper.KHMER);
// Explicit but unrecognized context.
testOne(harness, "45", contextualE, "45", NumericShaper.ARABIC);
// The other explicit context.
testOne(harness, "45", contextualE, "\u136c\u136d", NumericShaper.ETHIOPIC);
// Context from the text. The first \\u is ethiopic, the second khmer.
testOne(harness, "45 \u134d 045 \u1782 045", contextualI,
"45 \u134d 0\u136c\u136d \u1782 \u17e0\u17e4\u17e5", -1);
harness.checkPoint("arabic");
NumericShaper arabic
= NumericShaper.getContextualShaper(NumericShaper.ARABIC
| NumericShaper.EASTERN_ARABIC);
// According to testing, eastern arabic takes precedence here.
testOne(harness, "\u062b 1", arabic, "\u062b \u06f1", -1);
// This should choose eastern arabic.