aports/community/gojq/fix-tests.patch
2024-04-08 19:55:53 +00:00

50 lines
2.0 KiB
Diff

Patch-Source: https://github.com/itchyny/gojq/commit/8874f53e90f86de3d52165d5719e09e0cae69e4a.patch
--
From 8874f53e90f86de3d52165d5719e09e0cae69e4a Mon Sep 17 00:00:00 2001
From: itchyny <itchyny@cybozu.co.jp>
Date: Tue, 2 Apr 2024 19:14:34 +0900
Subject: [PATCH] fix tests of exp10 and atan2 failing on some platforms (close
#247)
---
cli/test.yaml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/cli/test.yaml b/cli/test.yaml
index 2817debc..e83af32b 100644
--- a/cli/test.yaml
+++ b/cli/test.yaml
@@ -4089,12 +4089,12 @@
args:
- -c
- 'map(exp), map(exp10), map(exp2), map(expm1) | map(. * 1000000000 | floor / 1000000000)'
- input: '[0, -0.5, 1, -1.5, 2, 10, 100]'
+ input: '[0, -0.5, 1, -1.5, 2, 10, 20]'
expected: |
- [1,0.606530659,2.718281828,0.22313016,7.389056098,22026.465794806,2.6881171418161356e+43]
- [1,0.316227766,10,0.031622776,100,10000000000,1.0000000000000002e+100]
- [1,0.707106781,2,0.35355339,4,1024,1.2676506002282294e+30]
- [0,-0.393469341,1.718281828,-0.77686984,6.389056098,22025.465794806,2.6881171418161356e+43]
+ [1,0.606530659,2.718281828,0.22313016,7.389056098,22026.465794806,485165195.4097903]
+ [1,0.316227766,10,0.031622776,100,10000000000,99999999999999980000]
+ [1,0.707106781,2,0.35355339,4,1024,1048576]
+ [0,-0.393469341,1.718281828,-0.77686984,6.389056098,22025.465794806,485165194.4097903]
- name: frexp, modf function
args:
@@ -4174,11 +4174,11 @@
- name: atan2/2, hypot/2 functions
args:
- -c
- - '[atan2(0,1; 0,1,-3)], [hypot(0,-3.75,12; 0,5,-16)]'
+ - '[atan2(0,1; 0,1,-3)], [hypot(0,-3.75,12; 0,5,-16)] | map(. * 1000000000 | floor / 1000000000)'
input: 'null'
expected: |
- [0,1.5707963267948966,0,0.7853981633974483,3.141592653589793,2.819842099193151]
- [0,3.75,12,5,6.25,13,16,16.433578429544795,20]
+ [0,1.570796326,0,0.785398163,3.141592653,2.819842099]
+ [0,3.75,12,5,6.25,13,16,16.433578429,20]
- name: ldexp/2, scalb/2, scalbln/2 functions
args: