Unverified Commit a4bcdbcf authored by Binbin's avatar Binbin Committed by GitHub
Browse files

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. 
parent e4eb18b3
...@@ -43,14 +43,16 @@ start_server {tags {"modules"}} { ...@@ -43,14 +43,16 @@ start_server {tags {"modules"}} {
} }
test "RESP$proto: RM_ReplyWithDouble: NaN" { 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} { if {$proto == 2} {
assert_equal "-nan" [r rw.double 0 0] assert_match "*nan" [r rw.double 0 0]
assert_equal "nan" [r rw.double] assert_match "*nan" [r rw.double]
} else { } else {
# TCL won't convert nan into a double, use readraw to verify the protocol # TCL won't convert nan into a double, use readraw to verify the protocol
r readraw 1 r readraw 1
assert_equal ",-nan" [r rw.double 0 0] assert_match ",*nan" [r rw.double 0 0]
assert_equal ",nan" [r rw.double] assert_match ",*nan" [r rw.double]
r readraw 0 r readraw 0
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment