Open eernstg opened 7 years ago
Surprisingly, the buildbot analyzer-win7-release-be in build 2617 reports the expected syntax error, and the test is considered to be failing:
FAILED: dart2analyzer-none release_x64 language/bad_raw_string_negative_test
Expected: Pass
Actual: CompileTimeError
CommandOutput[dart2analyzer]:
stderr:
ERROR|SYNTACTIC_ERROR|UNTERMINATED_STRING_LITERAL|E:\\b\\build\\slave\\analyzer-win7-release-be\\build\\sdk\\tests\\language\\bad_raw_string_negative_test.dart|7|12|1|Unterminated string literal.
ERROR|SYNTACTIC_ERROR|UNTERMINATED_STRING_LITERAL|E:\\b\\build\\slave\\analyzer-win7-release-be\\build\\sdk\\tests\\language\\bad_raw_string_negative_test.dart|7|16|1|Unterminated string literal.
ERROR|SYNTACTIC_ERROR|EXPECTED_TOKEN|E:\\b\\build\\slave\\analyzer-win7-release-be\\build\\sdk\\tests\\language\\bad_raw_string_negative_test.dart|8|1|1|Expected to find ';'.
ERROR|SYNTACTIC_ERROR|EXPECTED_TOKEN|E:\\b\\build\\slave\\analyzer-win7-release-be\\build\\sdk\\tests\\language\\bad_raw_string_negative_test.dart|8|1|1|Expected to find ')'.
So test.py on the buildbot analyzer-win7-release-be considers the test to fail when it has a compile-time error even though its name is '*_negative_test.dart', and on analyzer-linux-release-be we get this:
Done dart2analyzer-none release_x64 language/bad_raw_string_negative_test: pass
where a local test confirms that dartanalizer runs without emitting any error messages.
Given that this seems to involve both the testing infrastructure and the analyzer, I've removed the 'area-' label.
If we add another newline inside the string, then the test fails on linux as well.
Compiler commands that fail ignore the "isNegative" state when returning their output. I will fix this, but this might break other tests, that are called _negative_test but only fail at runtime, not compilation.
There is no "isNegative" flag that can be put in the comments, or "compilationError" that can be put in the comments, because those flags are only in co19 tests.
I have made this test into a multitest called bad_raw_string_test.dart, and included a test like the current one for the case of a raw string with a single character, which is a newline, which fails to produce a compile time error on linux and mac. Marking it in the status file with this issue, which I have renamed.
The test
tests/language/bad_raw_string_negative_test.dart
includes a raw string containing a new line, and this cannot be derived from stringLiteral in the language specification, so it should be a syntax error.Currently (Feb 7, 2017), we get this: