Lints and suggestions for the Nix programming language
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

test(bool_comparison): both-side-bool cases

Co-authored-by: x10an14 <x10an14@users.noreply.github.com>

+46 -1
+6
bin/tests/data/bool_comparison.nix
··· 14 14 # non-matches 15 15 (i == j) 16 16 (k != l) 17 + 18 + # both sides bool 19 + (false == false) 20 + (false == true) 21 + (true == false) 22 + (true == true) 17 23 ]
+12 -1
bin/tests/snapshots/main__bool_comparison_fix.snap
··· 4 4 --- 5 5 --- tests/data/bool_comparison.nix 6 6 +++ tests/data/bool_comparison.nix [fixed] 7 - @@ -1,16 +1,16 @@ 7 + @@ -1,23 +1,23 @@ 8 8 [ 9 9 # trivial 10 10 - (a == true) ··· 29 29 # non-matches 30 30 (i == j) 31 31 (k != l) 32 + 33 + # both sides bool 34 + - (false == false) 35 + - (false == true) 36 + - (true == false) 37 + - (true == true) 38 + + (!false) 39 + + (!true) 40 + + false 41 + + true 42 + ]
+28
bin/tests/snapshots/main__bool_comparison_lint.snap
··· 58 58 · ─────┬──── 59 59 · ╰────── Comparing h with boolean literal false 60 60 ────╯ 61 + [W01] Warning: Unnecessary comparison with boolean 62 + ╭─[data/bool_comparison.nix:19:4] 63 + 64 + 19 │ (false == false) 65 + · ───────┬────── 66 + · ╰──────── Comparing false with boolean literal false 67 + ────╯ 68 + [W01] Warning: Unnecessary comparison with boolean 69 + ╭─[data/bool_comparison.nix:20:4] 70 + 71 + 20 │ (false == true) 72 + · ──────┬────── 73 + · ╰──────── Comparing true with boolean literal false 74 + ────╯ 75 + [W01] Warning: Unnecessary comparison with boolean 76 + ╭─[data/bool_comparison.nix:21:4] 77 + 78 + 21 │ (true == false) 79 + · ──────┬────── 80 + · ╰──────── Comparing false with boolean literal true 81 + ────╯ 82 + [W01] Warning: Unnecessary comparison with boolean 83 + ╭─[data/bool_comparison.nix:22:4] 84 + 85 + 22 │ (true == true) 86 + · ──────┬───── 87 + · ╰─────── Comparing true with boolean literal true 88 + ────╯