Fix size call with equation.

This commit is contained in:
A Samuel Pottinger
2022-11-27 19:04:56 +00:00
parent 1ca265aa43
commit 54426cb8a7
6 changed files with 167 additions and 8 deletions

View File

@@ -50,6 +50,22 @@ public class ParserTests {
}
}
static void expectRunnerException(final String id) {
try {
preprocess(id, res(id + ".pde"));
fail("Expected to fail");
} catch (SketchException e) {
assertNotNull(e);
} catch (PdePreprocessIssueException e) {
assertNotNull(e.getIssue().getMsg());
} catch (Exception e) {
if (!e.equals(e.getCause()) && e.getCause() != null)
fail(e.getCause().toString());
else
fail(e.toString());
}
}
static void expectRunnerException(final String id,
final int expectedLine) {
@@ -453,4 +469,19 @@ public class ParserTests {
expectGood("customrootclass");
}
@Test
public void testExpessionSize() {
expectGood("expressionsize");
}
@Test
public void testExpessionSizeMethod() {
expectRunnerException("expressionsizemethod");
}
@Test
public void testExpessionSizeVar() {
expectRunnerException("expressionsizevar");
}
}