Skip to content

Commit

Permalink
Incorrect loop syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw429s committed Oct 18, 2023
1 parent 7541a0c commit 04f08b2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/test/java/TestCases/phase1/CoreLangTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.util.concurrent.TimeUnit;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

import ortus.boxlang.runtime.BoxRuntime;
import ortus.boxlang.runtime.context.IBoxContext;
Expand Down Expand Up @@ -228,18 +231,16 @@ public void testWhileLoop() {

@DisplayName( "do while loop" )
@Test
@Timeout( value = 5, unit = TimeUnit.SECONDS )
public void testDoWhileLoop() {

// Don't know what " no viable alternative at input" mwans
instance.executeSource(
"""
do {
result = 1;
} while( result < "10" ) {
// while logic
result = 1;
do {
result = variables.result + 1;
}
""",
} while( result < 10 )
""",
context );
assertThat( variables.dereference( result, false ) ).isEqualTo( 10 );

Expand Down

0 comments on commit 04f08b2

Please sign in to comment.