diff options
author | Binbin <binloveplay1314@qq.com> | 2022-11-15 23:18:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 17:18:21 +0200 |
commit | a4bcdbcfd3a055eb6320f31e5c710931708a9501 (patch) | |
tree | 6336a7e353ef03a746e047ef0f0481866033e20f /tests | |
parent | e4eb18b303d716aeebc4153176a6cd93b8bd5d66 (diff) | |
download | redis-a4bcdbcfd3a055eb6320f31e5c710931708a9501.tar.gz |
Fix double negative nan test, ignoring sign (#11506)
The test introduced in #11482 fail on ARM (extra CI):
```
*** [err]: RESP2: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected '-nan' to be equal to 'nan' (context: type eval line 3 cmd
{assert_equal "-nan" [r rw.double 0 0]} proc ::test)
*** [err]: RESP3: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected ',-nan' to be equal to ',nan' (context: type eval line 8 cmd
{assert_equal ",-nan" [r rw.double 0 0]} proc ::test)
```
It looks like there is no negative nan on ARM.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/moduleapi/reply.tcl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unit/moduleapi/reply.tcl b/tests/unit/moduleapi/reply.tcl index 7a8e74dfc..8f930138e 100644 --- a/tests/unit/moduleapi/reply.tcl +++ b/tests/unit/moduleapi/reply.tcl @@ -43,14 +43,16 @@ start_server {tags {"modules"}} { } test "RESP$proto: RM_ReplyWithDouble: NaN" { + # On some platforms one of these can be -nan but we don't care since they are + # synonym, so here we match ignoring the sign if {$proto == 2} { - assert_equal "-nan" [r rw.double 0 0] - assert_equal "nan" [r rw.double] + assert_match "*nan" [r rw.double 0 0] + assert_match "*nan" [r rw.double] } else { # TCL won't convert nan into a double, use readraw to verify the protocol r readraw 1 - assert_equal ",-nan" [r rw.double 0 0] - assert_equal ",nan" [r rw.double] + assert_match ",*nan" [r rw.double 0 0] + assert_match ",*nan" [r rw.double] r readraw 0 } } |