Skip to content

Commit a352814

Browse files
committedMay 21, 2024
fix: count unexpected exceptions as failures
1 parent 66904d8 commit a352814

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed
 

‎src/TestDriver.php

+2
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ public function printResult(bool $result, ?string $why = null, $value = null, $e
277277

278278
public function printError(Throwable $error)
279279
{
280+
$this->failures += 1;
281+
280282
echo "ERROR\n" . $this->indent($this->formatError($error));
281283
}
282284

‎test/expected-output.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ ERROR
7676

7777

7878
Code Coverage Report:
79-
2024-05-21 16:30:53
79+
2024-05-21 17:04:44
8080

8181
Summary:
8282
Classes: 0.00% (0/4)
8383
Methods: 20.59% (7/34)
84-
Lines: 51.96% (186/358)
84+
Lines: 52.22% (188/360)
8585

8686
mindplay\testies\TestDriver
87-
Methods: 35.29% ( 6/17) Lines: 64.56% (102/158)
87+
Methods: 35.29% ( 6/17) Lines: 65.00% (104/160)
8888
mindplay\testies\readable
8989
Methods: 12.50% ( 1/ 8) Lines: 50.00% ( 58/116)
9090

9191
* code coverage report created: test/build/clover.xml
9292

93-
* 1 tests completed: 26 assertions, 14 failures
93+
* 1 tests completed: 26 assertions, 15 failures

‎test/test.php

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ function () {
2424
eq(format([1,2,3]), "array[3]");
2525
eq(format(true), "TRUE");
2626
eq(format(false), "FALSE");
27-
eq(format(new Foo), "Foo");
2827
}
2928
);
3029

0 commit comments

Comments
 (0)
Please sign in to comment.