tolerant-php-parser icon indicating copy to clipboard operation
tolerant-php-parser copied to clipboard

Make error-handling more testable

Open mousetraps opened this issue 8 years ago • 2 comments

e.g. right now we test that skipped/missing tokens are properly included in the tree, but we have no tests for the post-parse getDiagnostics walk.

Thoughts?

mousetraps avatar Feb 16 '17 17:02 mousetraps

I am currently playing around with this. What I have so far is similar to the mechanism by which the generated AST is tested: For each test case X.php there is an accompanying file X.php.diag that contains the JSON-serialized output of the DiagnosticsProvider.

Are localized error messages planned? IMHO it's not that important to ensure that error messages stay the exact same between test runs. Maybe a "system-readable" l10n setting could provide stable messages between test runs.

sunverwerth avatar Sep 27 '17 19:09 sunverwerth

What I have so far is similar to the mechanism by which the generated AST is tested:

That sounds like the right approach

Are localized error messages planned?

Definitely not in the near future at least.

roblourens avatar Sep 27 '17 19:09 roblourens