Design #1501
testing for syntax errors
Description
In CoCoA-5 test files, computational errors can be captured inside a try...entry
block,
but syntax errors cannot.
I wanted to create a test file for the new export skip
capability.
Unfortunately, although the file is entirely read and produces the expected error mesgs (all on cout
for some reason!),CoCoAInterpreter
exits with non-zero code; so the test script regard the test as having failed (which is the intention).
Is it worth trying to modify the testing mechanism so that some tests can be marked as "should fail"?
Related issues
History
#1 Updated by John Abbott over 3 years ago
I am quite undecided about this.
For "run-time" errors we have the possibility of handling them via try...endtry
; so they can be e.g. verified and discarded.
On one hand it would be nice to have a means of checking that syntax errors are properly detected and reported;
on the other, we only very rarely change the interpreter, so only rarely would we need to check that parsing works as desired.
Such rare checks could perhaps be performed by hand?
At the moment I do have much desire to meddle with the existing testing mechanism (which has been working fine for quite some time).
NOTE syntax errors inside a package
are handled specially: parsing continues after the syntax error, whereas a syntax error elsewhere seems to stop further parsing (though possibly not absolutely immediately)
#2 Updated by John Abbott over 3 years ago
- Related to Design #1495: Package exporting nothing? added
#3 Updated by John Abbott over 2 years ago
The idea itself is not so bad, but actually implementing looks to be nightmarish.
I am inclined to reject this issue on the grounds that it would be too costly/tricky to implement, and that the gains are not so great.
Opinions?
#4 Updated by John Abbott over 2 years ago
- Subject changed from tests which produce errors to testing for syntax errors
- Status changed from New to Rejected
- Assignee set to John Abbott
- % Done changed from 0 to 100
Since we cannot see how to do this in a reasonable way, we reject the issue.