From 6e1914aea991eb94027c079e45ad8e8a32bdb640 Mon Sep 17 00:00:00 2001 From: domenico Date: Mon, 25 Nov 2024 16:06:27 +0100 Subject: [PATCH] Add test case --- .../smeup/rpgparser/evaluation/InterpreterTest.kt | 6 ++++++ .../src/test/resources/GOTOTST10.rpgle | 13 +++++++++++++ .../src/test/resources/GOTOTST10B.rpgle | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 rpgJavaInterpreter-core/src/test/resources/GOTOTST10.rpgle create mode 100644 rpgJavaInterpreter-core/src/test/resources/GOTOTST10B.rpgle diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/InterpreterTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/InterpreterTest.kt index 61a1c9dc1..cb1565df8 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/InterpreterTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/InterpreterTest.kt @@ -1399,6 +1399,12 @@ Test 6 assertEquals(expected, outputOf("GOTOTST9")) } + @Test + fun executeGOTOTST10() { + val expected = listOf("ok", "ok") + assertEquals(expected, outputOf("GOTOTST10")) + } + @Test fun executeGotoENDSR() { assertEquals(listOf("1", "2", "3"), outputOf("GOTOENDSR")) diff --git a/rpgJavaInterpreter-core/src/test/resources/GOTOTST10.rpgle b/rpgJavaInterpreter-core/src/test/resources/GOTOTST10.rpgle new file mode 100644 index 000000000..0827bc777 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/GOTOTST10.rpgle @@ -0,0 +1,13 @@ + V* ============================================================== + V* 25/11/2024 APU002 Creation + V* ============================================================== + O * PROGRAM GOAL + O * Execute a subroutine with a CALL to a program performing a top-level GOTO + V* ============================================================== + C EXSR SR1 + C SETON LR + + C SR1 BEGSR + C CALL 'GOTOTST10B' + C 'ok' DSPLY + C ENDSR diff --git a/rpgJavaInterpreter-core/src/test/resources/GOTOTST10B.rpgle b/rpgJavaInterpreter-core/src/test/resources/GOTOTST10B.rpgle new file mode 100644 index 000000000..9f56f4895 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/GOTOTST10B.rpgle @@ -0,0 +1,10 @@ + V* ============================================================== + V* 25/11/2024 APU002 Creation + V* ============================================================== + O * PROGRAM GOAL + O * Being called by 'GOTOTST10.rpgle' + V* ============================================================== + C GOTO TAG1 + C 'ko' DSPLY + C TAG1 TAG + C 'ok' DSPLY \ No newline at end of file