From 3e01978f227dae3857924124179ca65971128749 Mon Sep 17 00:00:00 2001 From: aNNiMON Date: Mon, 2 Oct 2023 19:00:34 +0300 Subject: [PATCH] Run tests with maximum optimization --- .../src/test/java/com/annimon/ownlang/parser/ProgramsTest.java | 2 ++ ownlang-parser/src/test/resources/other/useStatementScope.own | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) 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)) }