Skip to content

Commit

Permalink
test for cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidanio committed Mar 22, 2024
1 parent 2c84831 commit 5d8e078
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/tests/checkers/dangerouse_condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,21 @@ if($a || false && 1 || true){
}
test.RunAndMatch()
}

func TestDangerousCondition5(t *testing.T) {
test := linttest.NewSuite(t)
test.AddFile(`<?php
while(true){
}
do{
}while(1);
`)
test.Expect = []string{
`Potential dangerous bool value: you have constant bool value in condition`,
`Potential dangerous value: you have constant int value that interpreted as bool`,
}
test.RunAndMatch()
}

0 comments on commit 5d8e078

Please sign in to comment.