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

Method checkSymbol

src/test/java/com/amazon/ion/IonTestCase.java:764–784  ·  view source on GitHub ↗

@param text null means text is unknown

(String text, int sid, SymbolToken sym)

Source from the content-addressed store, hash-verified

762 * @param text null means text is unknown
763 */
764 public static void checkSymbol(String text, int sid, SymbolToken sym)
765 {
766 assertEquals("SymbolToken.text", text, sym.getText());
767
768 if (text != null)
769 {
770 assertEquals("SymbolToken.id", sid, sym.getSid());
771 assertEquals("SymbolToken.assumeText", text, sym.assumeText());
772 }
773 else
774 {
775 // Local symbols with unknown text may be treated equivalently to symbol zero.
776 assertTrue("SymbolToken.id", sid == sym.getSid() || 0 == sym.getSid());
777 try
778 {
779 sym.assumeText();
780 fail("expected exception");
781 }
782 catch (RuntimeException e) { }
783 }
784 }
785
786
787 /**

Callers 15

checkUnknownSymbolMethod · 0.95
annotationMethod · 0.95
checkSymbolMethod · 0.95
testConcatenationMethod · 0.45
modifySymbolMethod · 0.45
testSymbolsMethod · 0.45
testEmptySymbolMethod · 0.45

Calls 14

assertEqualsMethod · 0.95
getTextMethod · 0.95
getSidMethod · 0.95
checkTypeMethod · 0.95
stringValueMethod · 0.95
symbolValueMethod · 0.95
getSymbolIdMethod · 0.95
failMethod · 0.80
assumeTextMethod · 0.65
isNullValueMethod · 0.65
findKnownSymbolMethod · 0.65
findSymbolMethod · 0.65

Tested by

no test coverage detected