-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from smeup/feature/NW23001440/monitor-stmt
Feature/nw23001440/monitor stmt
- Loading branch information
Showing
11 changed files
with
306 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 44 additions & 1 deletion
45
rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT11Codop2Test.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,46 @@ | ||
package com.smeup.rpgparser.smeup | ||
|
||
open class MULANGT11Codop2Test : MULANGTTest() | ||
import org.junit.Test | ||
import kotlin.test.assertEquals | ||
|
||
open class MULANGT11Codop2Test : MULANGTTest() { | ||
/** | ||
* MONITOR and error catching | ||
* @see #241 | ||
*/ | ||
@Test | ||
fun executeT11_A10_P01() { | ||
val expected = listOf("BLOCCO; ERR_ZERO_DIV;") | ||
assertEquals(expected, "smeup/T11_A10_P01".outputOf()) | ||
} | ||
|
||
/** | ||
* Nested MONITOR statements | ||
* @see #241 | ||
*/ | ||
@Test | ||
fun executeT11_A10_P02() { | ||
val expected = listOf("BLOCCO1; BLOCCO2; BLOCCO3; ERR_ZERO_DIV; FINE_BLOCCO3;; ERR_ZERO_DIV; FINE_BLOCCO2;; ERR_ZERO_DIV; FINE_BLOCCO1;") | ||
assertEquals(expected, "smeup/T11_A10_P02".outputOf()) | ||
} | ||
|
||
/** | ||
* MONITOR nested in IF, DO and SELECT | ||
* @see #241 | ||
*/ | ||
@Test | ||
fun executeT11_A10_P03() { | ||
val expected = listOf("DENTRO_IF(BLOCCO; ERR_ZERO_DIV;) DENTRO_DO(BLOCCO; ERR_ZERO_DIV;BLOCCO; ERR_ZERO_DIV;) DENTRO_WHEN(BLOCCO; ERR_ZERO_DIV;) DENTRO_OTHER(BLOCCO; ERR_ZERO_DIV;)") | ||
assertEquals(expected, "smeup/T11_A10_P03".outputOf()) | ||
} | ||
|
||
/** | ||
* IF, DO and SELECT in MONITOR | ||
* @see #241 | ||
*/ | ||
@Test | ||
fun executeT11_A10_P04() { | ||
val expected = listOf("DENTRO_IF(BLOCCO; ERR_ZERO_DIV;) DENTRO_DO(BLOCCO; ERR_ZERO_DIV;) DENTRO_WHEN(BLOCCO; ERR_ZERO_DIV;) DENTRO_OTHER(BLOCCO; ERR_ZERO_DIV;)") | ||
assertEquals(expected, "smeup/T11_A10_P04".outputOf()) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
rpgJavaInterpreter-core/src/test/resources/smeup/T11_A10_P01.rpgle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
D £DBG_Str S 150 VARYING | ||
D T11_A10_A20A S 2 0 INZ(10) | ||
D T11_A10_A20B S 2 0 INZ(0) | ||
C MONITOR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'BLOCCO' | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; '+ | ||
C %CHAR(T11_A10_A20A/T11_A10_A20B) | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; FINE_BLOCCO;' | ||
C ON-ERROR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+ | ||
C '; ERR_ZERO_DIV;' | ||
C ENDMON | ||
C £DBG_Str DSPLY |
31 changes: 31 additions & 0 deletions
31
rpgJavaInterpreter-core/src/test/resources/smeup/T11_A10_P02.rpgle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
D £DBG_Str S 150 VARYING | ||
D T11_A10_A20A S 2 0 INZ(10) | ||
D T11_A10_A20B S 2 0 INZ(0) | ||
C MONITOR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'BLOCCO1;' | ||
C MONITOR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+' BLOCCO2;' | ||
C MONITOR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+' BLOCCO3' | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; '+ | ||
C %CHAR(T11_A10_A20A/T11_A10_A20B) | ||
C ON-ERROR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+ | ||
C '; ERR_ZERO_DIV;' | ||
C ENDMON | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+' FINE_BLOCCO3;' | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; '+ | ||
C %CHAR(T11_A10_A20A/T11_A10_A20B) | ||
C ON-ERROR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+ | ||
C '; ERR_ZERO_DIV;' | ||
C ENDMON | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+' FINE_BLOCCO2;' | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; '+ | ||
C %CHAR(T11_A10_A20A/T11_A10_A20B) | ||
C ON-ERROR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+ | ||
C '; ERR_ZERO_DIV;' | ||
C ENDMON | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+' FINE_BLOCCO1;' | ||
C £DBG_Str DSPLY |
36 changes: 36 additions & 0 deletions
36
rpgJavaInterpreter-core/src/test/resources/smeup/T11_A10_P03.rpgle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
D £DBG_Str S 180 VARYING | ||
D T11_A10_A20A S 2 0 INZ(10) | ||
D T11_A10_A20B S 2 0 INZ(0) | ||
C EVAL £DBG_Str='DENTRO_IF(' | ||
C IF 'A'='A' | ||
C EXSR SUB_SEZ_A10 | ||
C ENDIF | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+') DENTRO_DO(' | ||
C DO 2 | ||
C EXSR SUB_SEZ_A10 | ||
C ENDDO | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+') DENTRO_WHEN(' | ||
C SELECT | ||
C WHEN 'A'='A' | ||
C EXSR SUB_SEZ_A10 | ||
C ENDSL | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+') DENTRO_OTHER(' | ||
C SELECT | ||
C WHEN 'A'='B' | ||
C OTHER | ||
C EXSR SUB_SEZ_A10 | ||
C ENDSL | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+')' | ||
C £DBG_Str DSPLY | ||
|
||
C SUB_SEZ_A10 BEGSR | ||
C MONITOR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'BLOCCO' | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; '+ | ||
C %CHAR(T11_A10_A20A/T11_A10_A20B) | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+'; FINE_BLOCCO;' | ||
C ON-ERROR | ||
C EVAL £DBG_Str=%TRIM(£DBG_Str)+ | ||
C '; ERR_ZERO_DIV;' | ||
C ENDMON | ||
C ENDSR |
Oops, something went wrong.