From bcad700d6cc25ec67e3fdd331a6efdb316bbcbc3 Mon Sep 17 00:00:00 2001 From: JackProgramsJP Date: Thu, 27 Aug 2026 11:39:22 -0700 Subject: [PATCH] float redundant zero comparison test instead asserts no warning for correct test result --- ...literals_redundant_comparison_signed_zero.snap | 15 --------------- compiler-core/src/type_/tests/warnings.rs | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__float_literals_redundant_comparison_signed_zero.snap diff --git a/compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__float_literals_redundant_comparison_signed_zero.snap b/compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__float_literals_redundant_comparison_signed_zero.snap deleted file mode 100644 index 42a79bc19..000000000 --- a/compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__float_literals_redundant_comparison_signed_zero.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: compiler-core/src/type_/tests/warnings.rs -expression: "pub fn main() { 0.0 == -0.0 }" ---- ------ SOURCE CODE -pub fn main() { 0.0 == -0.0 } - ------ WARNING -warning: Redundant comparison - ┌─ /src/warning/wrn.gleam:1:17 - │ -1 │ pub fn main() { 0.0 == -0.0 } - │ ^^^^^^^^^^^ This is always `True` - -This comparison is redundant since it always succeeds. diff --git a/compiler-core/src/type_/tests/warnings.rs b/compiler-core/src/type_/tests/warnings.rs index 1f69c743e..446aca981 100644 --- a/compiler-core/src/type_/tests/warnings.rs +++ b/compiler-core/src/type_/tests/warnings.rs @@ -4451,7 +4451,7 @@ fn float_literals_redundant_comparison_infinity() { #[test] fn float_literals_redundant_comparison_signed_zero() { - assert_warning!("pub fn main() { 0.0 == -0.0 }"); + assert_no_warnings!("pub fn main() { 0.0 == -0.0 }"); } #[test] -- 2.51.2