public void test_decimalDollarVariables_notOk() throws Exception {
// if
String code = "if 'abc' == 'abc' {\n" + //
"notice(\"$1\")" + //
"}\n"; //
XtextResource r = getResourceFromString(code);
tester.validate(r.getContents().get(0)).assertOK();
resourceWarningDiagnostics(r).assertDiagnostic(IPPDiagnostics.ISSUE__UNKNOWN_REGEXP);
resourceErrorDiagnostics(r).assertOK();
// case
code = "case 'abc' {\n" + //
"abc:" + "{ notice(\"$1\") }" + //
"}\n"; //
r = getResourceFromString(code);
tester.validate(r.getContents().get(0)).assertOK();
resourceWarningDiagnostics(r).assertDiagnostic(IPPDiagnostics.ISSUE__UNKNOWN_REGEXP);
resourceErrorDiagnostics(r).assertOK();
// selector
code = "$a = 'abc' ? {\n" + //
"'abc' =>" + "$1\n" + //
"}\n"; //
r = getResourceFromString(code);
AssertableDiagnostics asserter = tester.validate(r.getContents().get(0));
asserter.assertAll(AssertableDiagnostics.warningCode(IPPDiagnostics.ISSUE__MISSING_DEFAULT));
resourceWarningDiagnostics(r).assertAll(
AssertableResourceDiagnostics.diagnostic(IPPDiagnostics.ISSUE__UNKNOWN_REGEXP));
resourceErrorDiagnostics(r).assertOK();
}