mirror of
https://github.com/processing/processing4.git
synced 2026-03-23 12:57:26 +01:00
Add tests and fix for package name override.
This commit is contained in:
@@ -88,8 +88,12 @@ public class ParserTests {
|
||||
}
|
||||
|
||||
static void expectGood(final String id, boolean ignoreWhitespace) {
|
||||
expectGood(id, ignoreWhitespace, Optional.empty());
|
||||
}
|
||||
|
||||
static void expectGood(final String id, boolean ignoreWhitespace, Optional<String> packageName) {
|
||||
try {
|
||||
final String program = preprocess(id, res(id + ".pde"));
|
||||
final String program = preprocess(id, res(id + ".pde"), packageName);
|
||||
boolean successful = compile(id, program);
|
||||
if (successful) {
|
||||
System.err.println("----------------------------");
|
||||
@@ -368,6 +372,11 @@ public class ParserTests {
|
||||
expectGood("typeinference");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPackage() {
|
||||
expectGood("packageTest", true, Optional.of("test.subtest"));
|
||||
}
|
||||
|
||||
private static boolean compile(String id, String program) {
|
||||
// Create compilable AST to get syntax problems
|
||||
CompilationUnit compilableCU = JdtCompilerUtil.makeAST(
|
||||
|
||||
Reference in New Issue
Block a user