From 2a2e5d416ad42eaa33088387637fc48586b45e63 Mon Sep 17 00:00:00 2001 From: Binbin Date: Mon, 14 Nov 2022 17:07:10 +0800 Subject: [PATCH] Fix double inf test, use readraw to verify the protocol (#11504) The test introduced in #11482 fail on mac: ``` *** [err]: RESP3: RM_ReplyWithDouble: inf in tests/unit/moduleapi/reply.tcl Expected 'Inf' to be equal to 'inf' (context: type eval line 6 cmd {assert_equal Inf [r rw.double inf]} proc ::test) ``` Looks like the mac platform returns inf instead of Inf in this case, this PR uses readraw to verify the protocol. --- tests/unit/moduleapi/reply.tcl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/moduleapi/reply.tcl b/tests/unit/moduleapi/reply.tcl index fefd0a5aa..7a8e74dfc 100644 --- a/tests/unit/moduleapi/reply.tcl +++ b/tests/unit/moduleapi/reply.tcl @@ -33,8 +33,12 @@ start_server {tags {"modules"}} { assert_equal "inf" [r rw.double inf] assert_equal "-inf" [r rw.double -inf] } else { - assert_equal Inf [r rw.double inf] - assert_equal -Inf [r rw.double -inf] + # TCL convert inf to different results on different platforms, e.g. inf on mac + # and Inf on others, so use readraw to verify the protocol + r readraw 1 + assert_equal ",inf" [r rw.double inf] + assert_equal ",-inf" [r rw.double -inf] + r readraw 0 } }