mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8318811: Compiler directives parser swallows a character after line comments
Backport-of: 141dae8b76
This commit is contained in:
committed by
Vitaly Provodin
parent
fed7bfe117
commit
2b437db473
@@ -580,7 +580,7 @@ u_char JSON::skip_line_comment() {
|
||||
return 0;
|
||||
}
|
||||
next();
|
||||
return next();
|
||||
return peek();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
|
||||
package compiler.compilercontrol.parser;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import compiler.compilercontrol.share.JSONFile;
|
||||
import jdk.test.lib.Asserts;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
@@ -52,6 +55,7 @@ public class DirectiveParserTest {
|
||||
emptyFile();
|
||||
noFile();
|
||||
directory();
|
||||
lineCommentTest();
|
||||
}
|
||||
|
||||
private static void simpleTest() {
|
||||
@@ -145,4 +149,20 @@ public class DirectiveParserTest {
|
||||
Asserts.assertNE(output.getExitValue(), 0, ERROR_MSG + "directory as "
|
||||
+ "a name");
|
||||
}
|
||||
|
||||
private static void lineCommentTest() {
|
||||
String fileName = "lineComment.json";
|
||||
try {
|
||||
PrintStream out = new PrintStream(fileName);
|
||||
out.println("[{");
|
||||
out.println(" match: \"*::*\",");
|
||||
out.println(" c2: { Exclude: true } // c1 only for startup");
|
||||
out.println("}]");
|
||||
out.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new Error("TESTBUG: can't open/create file " + fileName, e);
|
||||
}
|
||||
OutputAnalyzer output = HugeDirectiveUtil.execute(fileName);
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user