Skip to content

Commit

Permalink
tests: fixed some tests for ifstatements rule
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 65c65d7a44bad5b77c15674caba90e34d89e5ad14a58d68003feda3051beb529
  • Loading branch information
thindil committed Mar 2, 2024
1 parent b1fb3f7 commit e5efe8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/ifstatements.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import utils/helpers

runRuleTest(files = @["ifstatements"], validOptions = @["all"],
invalidOptions = @["randomoption", "anotheroption", "andmoreoption"],
disabledChecks = {negativeFix, invalidSearch})
disabledChecks = {fixTests, invalidSearch})

runRuleTest(files = @["ifstatements"], validOptions = @["max", "3"],
invalidOptions = @["randomoption2", "anotheroption2", "andmoreoption2"],
Expand Down
13 changes: 9 additions & 4 deletions tests/invalid/ifstatements.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ let a = 0

if a != 1:
echo "not equal"
elif a == 2:
echo "equal to 2"
elif a == 3:
echo "equal to 3"
else:
echo "equal"

if a == 0:
discard

if a == 0:
echo "zero"
elif a == 1:
echo "one"
elif a == 2:
echo "two"
else:
echo "more"

when sizeof(int) == 2:
echo "running on a 16 bit system!"
elif sizeof(int) == 4:
Expand Down

0 comments on commit e5efe8f

Please sign in to comment.