From 57e593bea1eee53696b16a406e33d2721ab3644c Mon Sep 17 00:00:00 2001 From: mauke Date: Tue, 13 Aug 2024 16:07:51 +0200 Subject: [PATCH] fix precedence issue in uniqnum.t The test `!$nanish != $NaN` doesn't make much sense: It checks whether a boolean (effectively 0 or 1) is not equal to `$NaN`, which is always true. (Also, we know `$nanish != 0` from the preceding test, so `!$nanish` could be hardcoded as 0 here.) Instead test whether `$NaN` correctly round-trips through strings, i.e. whether `$nanish` behaves like a proper NaN again (being non-equal to both the original `$NaN` and itself). --- t/uniqnum.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/uniqnum.t b/t/uniqnum.t index 496835e..ca218cd 100644 --- a/t/uniqnum.t +++ b/t/uniqnum.t @@ -215,7 +215,7 @@ SKIP: { } if (eval { my $nanish = "$NaN" + 0; - $nanish != 0 && !$nanish != $NaN; + $nanish != 0 && $nanish != $NaN && $nanish != $nanish; }) { push @nums, $NaN; }