-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63ad3eb
commit 1c519dc
Showing
3 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
selene-lib/tests/lints/compare_nan/compare_nan_if.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-if x == 0/0 then | ||
+if x ~= x then | ||
end | ||
|
||
-if x ~= 0/0 then | ||
+if x == x then | ||
end | ||
|
||
if x ~= x then | ||
end | ||
|
||
if x >= 0/0 then | ||
end | ||
|
||
if 1 == 0/0 then | ||
end | ||
|
||
if 1 ~= 0/0 then | ||
end | ||
|
||
if 1 + 0/0 then | ||
end | ||
|
||
if y.foo() == 0/0 then | ||
end | ||
|
||
if y.bar() ~= 0/0 then | ||
end | ||
|
||
if x == 1 then | ||
end | ||
|
||
if 1 == 0 then | ||
end |
15 changes: 15 additions & 0 deletions
15
selene-lib/tests/lints/compare_nan/compare_nan_variables.fixed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local _ = 0/0 | ||
local _ = 1 ~= 0/0 | ||
local _ = 2 == 0/0 | ||
local _ = 3 + 0/0 | ||
local _ = 4 >= 0/0 | ||
-local _ = x ~= 0/0 | ||
-local _ = x == 0/0 | ||
+local _ = x == x | ||
+local _ = x ~= x | ||
local _ = x >= 0/0 | ||
local _ = y.foo() == 0/0 | ||
local _ = y.bar() ~= 0/0 | ||
|
||
local _ = x == 1 | ||
local _ = 1 == 0 |