Skip to content

Commit 88b2148

Browse files
committed
add test for parsing floats with positive exponents
1 parent 7ee123e commit 88b2148

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎src/test/groovy/graphql/parser/ParserTest.groovy‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,4 +698,23 @@ triple3 : """edge cases \\""" "" " \\"" \\" edge cases"""
698698
document.getIgnoredChars().getRight()[1] == new IgnoredChar(",", IgnoredChar.IgnoredCharKind.COMMA, new SourceLocation(3, 4))
699699
}
700700

701+
def "parsed float with positive exponent"() {
702+
given:
703+
def input = """
704+
{
705+
getEmployee (sal:1.7976931348155E+308){
706+
sal
707+
}
708+
}
709+
"""
710+
when:
711+
Document document = new Parser().parseDocument(input)
712+
Field getEmployee = (document.definitions[0] as OperationDefinition).selectionSet.selections[0]
713+
def argumentValue = getEmployee.getArguments().get(0).getValue()
714+
715+
then:
716+
argumentValue instanceof FloatValue
717+
((FloatValue) argumentValue).value.toString() == "1.7976931348155E+308"
718+
}
719+
701720
}

0 commit comments

Comments
 (0)