MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / testEscape

Method testEscape

src/test/java/com/amazon/ion/TextTestCase.java:59–79  ·  view source on GitHub ↗
(String ionText, int codeUnitCount)

Source from the content-addressed store, hash-verified

57 }
58
59 public void testEscape(String ionText, int codeUnitCount)
60 {
61 String ionData = wrap(ionText);
62 IonValue value = oneValue(ionData);
63 assertEquals(codeUnitCount, unwrap(value).length());
64
65 String printed = printed(ionText);
66 assertEquals(printed, value.toString());
67
68 // Try again after shoving the escape beyond the "short string" size
69 String spacer = "1234567890123456";
70 ionText = spacer + ionText;
71 codeUnitCount += spacer.length();
72
73 ionData = wrap(ionText);
74 value = oneValue(ionData);
75 assertEquals(codeUnitCount, unwrap(value).length());
76
77 printed = printed(ionText);
78 assertEquals(printed, value.toString());
79 }
80}

Callers 1

testUnicodeEscapesMethod · 0.95

Calls 7

wrapMethod · 0.95
unwrapMethod · 0.95
printedMethod · 0.95
toStringMethod · 0.95
lengthMethod · 0.80
oneValueMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected