Add test float

This commit is contained in:
Fabrice Reix 2023-12-13 08:13:52 +01:00
parent 85360eb8b3
commit 0b2c069ff0
No known key found for this signature in database
GPG Key ID: BF5213154B2E7155
2 changed files with 15 additions and 2 deletions

View File

@ -23,8 +23,19 @@ jsonpath "$.float" > 0.0
jsonpath "$.float" > 0
jsonpath "$.float" != null
# 0.1 in 64-bit floating-point format is really 0.10000000000000000555111512312578270211815834045410
# both 0.1 and 0.100000000000000005 have the same 64-bit float value
jsonpath "$.float2" == 0.1
jsonpath "$.float2" == 0.10000000000000000555111512312578270211815834045410
jsonpath "$.float2" == 0.100000000000000005
jsonpath "$.float2" < 0.1000000000000001
jsonpath "$.float3" == 0.1
jsonpath "$.float3" == 0.100000000000000005
{
"integer": 1,
"float": 1.0
"float": 1.0,
"float2": 0.1,
"float3": 0.100000000000000005
}

View File

@ -7,7 +7,9 @@ def predicates_number():
return Response(
"""{
"integer": 1,
"float": 1.0
"float": 1.0,
"float2": 0.1,
"float3": 0.100000000000000005
}""",
mimetype="application/json",
)