Skip to content

Commit 4397f23

Browse files
committed
try to kill mutations
1 parent 4085ef4 commit 4397f23

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/PHPStan/Analyser/nsrt/non-empty-string-str-containing-fns.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,29 @@ public function variants(string $s) {
110110
}
111111
assertType('string', $s);
112112

113+
$oneOrZero = rand(0, 1);
114+
if (strpos($s, '0') == $oneOrZero) { // 0|1|false
115+
assertType('string', $s);
116+
} else {
117+
assertType('string', $s);
118+
}
119+
assertType('string', $s);
120+
121+
$oneOrZero = rand(0, 1);
122+
if (strpos($s, '0') === $oneOrZero) {
123+
assertType('string', $s); // could be non-empty-string
124+
} else {
125+
assertType('string', $s);
126+
}
127+
assertType('string', $s);
128+
129+
if (strpos($s, '0') == 1) {
130+
assertType('string', $s); // could be non-empty-string
131+
} else {
132+
assertType('string', $s);
133+
}
134+
assertType('string', $s);
135+
113136
if (strpos($s, '0') === 0) {
114137
assertType('string', $s); // could be non-empty-string
115138
} else {

0 commit comments

Comments
 (0)