Skip to content

Commit

Permalink
test: Catch uncaught throwable in compare.php
Browse files Browse the repository at this point in the history
Example:

```
php test/compare.php test/Fixtures/lessjs-3.13.1/less/_main/
```

selectors.css has an uncaught `Error: Object could not be converted to string`
that currently stops the test instead of printing the summary.

Change-Id: I291e155a427dfbff5ce8d4c740fcbec5e16b2d6f
  • Loading branch information
Krinkle committed Apr 17, 2024
1 parent aea5d40 commit 6034560
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/compare.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public function handleFixture( $cssFile, $lessFile, $options ) {
$css = $parser->getCss();
} catch ( Less_Exception_Parser $e ) {
$css = $e->getMessage();
} catch ( Throwable $e ) {
$css = $e->__toString();
}
$css = trim( $css );

Expand Down

0 comments on commit 6034560

Please sign in to comment.