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

Method testFloats

src/test/java/com/amazon/ion/FloatTest.java:102–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100 }
101
102 @Test
103 public void testFloats()
104 {
105 IonFloat value = (IonFloat) oneValue("1.0e0");
106 assertSame(IonType.FLOAT, value.getType());
107 assertFalse(value.isNullValue());
108 assertArrayEquals(new String[0], value.getTypeAnnotations());
109 assertEquals(1.0F, value.floatValue());
110 assertEquals(1.0D, value.doubleValue());
111
112 // TODO more...
113
114 value = (IonFloat) oneValue("a::1.0e0");
115 assertFalse(value.isNullValue());
116 checkAnnotation("a", value);
117
118 // Ensure that annotation makes it through value mods
119 modifyFloat(value);
120 checkAnnotation("a", value);
121
122 // TODO test BigDecimal
123 }
124
125 @Test
126 public void testParsingSpecialFloats()

Callers

nothing calls this directly

Calls 9

floatValueMethod · 0.95
doubleValueMethod · 0.95
modifyFloatMethod · 0.95
getTypeMethod · 0.65
isNullValueMethod · 0.65
getTypeAnnotationsMethod · 0.65
oneValueMethod · 0.45
assertEqualsMethod · 0.45
checkAnnotationMethod · 0.45

Tested by

no test coverage detected