Update test integ

This commit is contained in:
Fabrice Reix 2023-12-14 17:58:07 +01:00 committed by hurl-bot
parent 112d0e9457
commit 9f0894e26d
No known key found for this signature in database
GPG Key ID: 1283A2B4A0DCAF8D
2 changed files with 26 additions and 11 deletions

View File

@ -1,5 +1,5 @@
# testing predicates
# on the number types: integer and float
# on the number types: integer, float and big integer
GET http://localhost:8000/predicates-number
HTTP 200
@ -25,17 +25,29 @@ 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
jsonpath "$.small_float1" isFloat
jsonpath "$.small_float1" == 0.1
jsonpath "$.small_float1" == 0.10000000000000000555111512312578270211815834045410
jsonpath "$.small_float1" == 0.100000000000000005
jsonpath "$.small_float1" > 0.0999999940395355224609375000000000000000
jsonpath "$.small_float2" == 0.1
# 1000000000000000000000.5 is really 1000000000000000000000.0 if 64-bit float
jsonpath "$.big_float1" isFloat
jsonpath "$.big_float1" == 1000000000000000000000.0
jsonpath "$.big_float1" == 1000000000000000000000.5
jsonpath "$.big_float2" == 1000000000000000000000.0
jsonpath "$.big_integer" == 1000000000000000000000
jsonpath "$.big_integer" isInteger
{
"integer": 1,
"float": 1.0,
"float2": 0.1,
"float3": 0.100000000000000005
"small_float1": 0.1,
"small_float2": 0.100000000000000005,
"big_float1": 1000000000000000000000.0,
"big_float2": 1000000000000000000000.5,
"big_integer": 1000000000000000000000
}

View File

@ -8,8 +8,11 @@ def predicates_number():
"""{
"integer": 1,
"float": 1.0,
"float2": 0.1,
"float3": 0.100000000000000005
"small_float1": 0.1,
"small_float2": 0.100000000000000005,
"big_float1": 1000000000000000000000.0,
"big_float2": 1000000000000000000000.5,
"big_integer": 1000000000000000000000
}""",
mimetype="application/json",
)