From 9f0894e26d79268b0d73bd52cb95e2d06caaa668 Mon Sep 17 00:00:00 2001 From: Fabrice Reix Date: Thu, 14 Dec 2023 17:58:07 +0100 Subject: [PATCH] Update test integ --- .../hurl/tests_ok/predicates_number.hurl | 30 +++++++++++++------ .../hurl/tests_ok/predicates_number.py | 7 +++-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/integration/hurl/tests_ok/predicates_number.hurl b/integration/hurl/tests_ok/predicates_number.hurl index 9fbbf2369b3..a1ea23f3b12 100644 --- a/integration/hurl/tests_ok/predicates_number.hurl +++ b/integration/hurl/tests_ok/predicates_number.hurl @@ -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 } diff --git a/integration/hurl/tests_ok/predicates_number.py b/integration/hurl/tests_ok/predicates_number.py index 7438b765755..0b93f10d7f4 100644 --- a/integration/hurl/tests_ok/predicates_number.py +++ b/integration/hurl/tests_ok/predicates_number.py @@ -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", )