mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
Resolve rewrite of pixelDensity to settings.
Per https://github.com/processing/processing4/issues/58, pixelDensity should run in settings and currently results in failure if used in static context. This will rewrite pixelDensity into the setting section if found in static or settings context. Adds unit tests for both scenarios.
This commit is contained in:
@@ -378,6 +378,16 @@ public class ParserTests {
|
||||
expectGood("packageTest", true, Optional.of("test.subtest"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStaticPixelDensity() {
|
||||
expectGood("staticpixeldensity");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParamPixelDensity() {
|
||||
expectGood("parampixeldensity");
|
||||
}
|
||||
|
||||
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