diff --git a/ownlang-parser/src/test/java/com/annimon/ownlang/parser/ProgramsTest.java b/ownlang-parser/src/test/java/com/annimon/ownlang/parser/ProgramsTest.java index 1244a6d..a6e059d 100644 --- a/ownlang-parser/src/test/java/com/annimon/ownlang/parser/ProgramsTest.java +++ b/ownlang-parser/src/test/java/com/annimon/ownlang/parser/ProgramsTest.java @@ -6,6 +6,7 @@ import com.annimon.ownlang.lib.ScopeHandler; import com.annimon.ownlang.parser.ast.FunctionDefineStatement; import com.annimon.ownlang.parser.ast.Statement; import com.annimon.ownlang.parser.ast.Visitor; +import com.annimon.ownlang.parser.optimization.OptimizationStage; import com.annimon.ownlang.parser.visitors.AbstractVisitor; import com.annimon.ownlang.stages.*; import org.junit.jupiter.api.BeforeAll; @@ -31,6 +32,7 @@ public class ProgramsTest { testPipeline = new SourceLoaderStage() .then(new LexerStage()) .then(new ParserStage()) + .thenConditional(true, new OptimizationStage(9)) .then(new ExecutionStage()) .then((stagesData, input) -> { input.accept(testFunctionsExecutor); diff --git a/ownlang-parser/src/test/resources/other/useStatementScope.own b/ownlang-parser/src/test/resources/other/useStatementScope.own index 32124fa..f90a6e4 100644 --- a/ownlang-parser/src/test/resources/other/useStatementScope.own +++ b/ownlang-parser/src/test/resources/other/useStatementScope.own @@ -16,8 +16,7 @@ def testInScope() { assertEquals("fallback", PI) useMath() - - assertEquals("fallback", PI) + assertNotEquals("fallback", PI) assertEquals(3, abs(-3)) }