Skip to content

Commit

Permalink
fix: NodeValue.makeNodeFloat(String) datatype XSDfloat
Browse files Browse the repository at this point in the history
test: TestNodeValue.float4 makeNodeFloat(String) is Float
  • Loading branch information
thomasjtaylor authored and afs committed Mar 27, 2024
1 parent ab3daca commit 4fb3ce2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public static NodeValue makeNodeFloat(float f)

public static NodeValue makeNodeFloat(String lexicalForm)
{
NodeValue nv = makeNode(lexicalForm, null, XSDdouble.getURI()) ;
NodeValue nv = makeNode(lexicalForm, null, XSDfloat.getURI()) ;
return nv ;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ public void testFloat3() {
assertTrue("Not same float: " + v1 + " & " + v2, v1.getFloat() == v2.getFloat());
assertTrue("Not same float as double: " + v1 + " & " + v2, v1.getDouble() == v2.getDouble());
}

@Test
public void testFloat4() {
NodeValue v1 = NodeValue.makeNodeFloat("5.7");
NodeValue v2 = NodeValue.makeFloat(5.7f);
assertTrue("Not same float: " + v1 + " & " + v2, v1.getFloat() == v2.getFloat());
assertTrue("Not same float as double: " + v1 + " & " + v2, v1.getDouble() == v2.getDouble());
}

@Test
public void testDouble1() {
Expand Down

0 comments on commit 4fb3ce2

Please sign in to comment.