mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-13 06:54:54 +03:00
Update test integ
This commit is contained in:
parent
112d0e9457
commit
9f0894e26d
@ -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
|
||||
}
|
||||
|
||||
|
@ -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",
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user