Class DevSourceOnlyOrError
java.lang.Object
org.ek9lang.compiler.common.DevSourceOnlyOrError
THE gate for a test construct (
assert, assertThrows, assertDoesNotThrow,
assertPanic, @Test) that may only appear in a dev source: reports
TEST_CONSTRUCT_IN_NON_DEV_SOURCE with the construct's name. A new test construct calls this; it never
writes the check and the message again.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanpermitted(boolean devSource, SemanticErrorReporter errorListener, IToken errorLocation, String construct) Test that the construct is in a dev source, reporting it if not.
-
Method Details
-
permitted
public static boolean permitted(boolean devSource, SemanticErrorReporter errorListener, IToken errorLocation, String construct) Test that the construct is in a dev source, reporting it if not.- Parameters:
devSource- true when the source being compiled is a dev (test) source.construct- the construct as written, without quotes, for exampleassertor@Test.- Returns:
- true when the construct is permitted here (a dev source); false when the error was reported.
-