From d90af8aef55dbd85da4821d1786d313f7a760f7c Mon Sep 17 00:00:00 2001 From: Domenico Date: Wed, 13 Mar 2024 14:15:19 +0100 Subject: [PATCH 01/10] Add unit tests for new ScanStmt logic --- .../evaluation/SmeupInterpreterTest.kt | 12 +++++++++++ .../test/resources/smeup/T10_A35_P08.rpgle | 18 +++++++++++++++++ .../test/resources/smeup/T10_A35_P10.rpgle | 20 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P08.rpgle create mode 100644 rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P10.rpgle diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt index b9a9a76c4..c9ef84148 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt @@ -598,6 +598,18 @@ open class SmeupInterpreterTest : AbstractTest() { assertEquals(expected, "smeup/T40_A20_P26".outputOf(configuration = smeupConfig)) } + @Test + fun executeT10_A35_P08() { + val expected = listOf("A35_AR1(2)(123&5) IN45(1)") + assertEquals(expected, "smeup/T10_A35_P08".outputOf(configuration = smeupConfig)) + } + + @Test + fun executeT10_A35_P10() { + val expected = listOf("A35_AR2(01)(5) A35_AR2(02)(6) A35_AR2(03)(0) IN20(1)") + assertEquals(expected, "smeup/T10_A35_P10".outputOf(configuration = smeupConfig)) + } + @Test fun executeT18_A10_P01() { val expected = listOf("Ritorno_Procedura") diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P08.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P08.rpgle new file mode 100644 index 000000000..e37b2aaa5 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P08.rpgle @@ -0,0 +1,18 @@ + D £DBG_Str S 150 VARYING + D A35_AR1 S 70 DIM(10) + D A35_A1 S 6 + D A35_A2 S 1 + D A35_AR2 S 2 0 DIM(5) + D $A S 1 0 + D I S 2 0 + + C EVAL A35_AR1(1)='ABCDEF' + C EVAL A35_AR1(2)='123&5' + C EVAL A35_AR1(3)='TEST&' + C EVAL I = 2 + C '&' SCAN A35_AR1(I):1 45 + C EVAL £DBG_Str= + C 'A35_AR1(2)('+%TRIMR(A35_AR1(2))+') ' + C +'IN45('+%CHAR(*IN45)+')' + + C £DBG_Str DSPLY \ No newline at end of file diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P10.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P10.rpgle new file mode 100644 index 000000000..976940a27 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A35_P10.rpgle @@ -0,0 +1,20 @@ + D £DBG_Str S 150 VARYING + D A35_AR1 S 70 DIM(10) + D A35_A1 S 6 + D A35_A2 S 1 + D A35_AR2 S 2 0 DIM(5) + D $A S 1 0 + D I S 2 0 + + C SETOFF 20 + C EVAL A35_A1='YARRYY' + C EVAL A35_A2='Y' + C EVAL $A=3 + C A35_A2 SCAN A35_A1:$A A35_AR2 20 + C EVAL £DBG_Str= + C 'A35_AR2(01)('+%CHAR(A35_AR2(01))+') ' + C +'A35_AR2(02)('+%CHAR(A35_AR2(02))+') ' + C +'A35_AR2(03)('+%CHAR(A35_AR2(03))+') ' + C +'IN20('+%CHAR(*IN20)+')' + + C £DBG_Str DSPLY \ No newline at end of file From 384e4df2f47a99999f8cd01962bd955f1b47ae3a Mon Sep 17 00:00:00 2001 From: Domenico Date: Wed, 13 Mar 2024 14:15:41 +0100 Subject: [PATCH 02/10] Extend ScanStmt to support expressions after colons --- .../smeup/rpgparser/parsing/ast/statements.kt | 8 +++-- .../rpgparser/parsing/parsetreetoast/misc.kt | 36 +++++++++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt index 531d89063..611475750 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt @@ -1704,7 +1704,7 @@ data class ScanStmt( val left: Expression, val leftLength: Int?, val right: Expression, - val startPosition: Int, + val startPosition: Expression?, val target: AssignableExpression?, val rightIndicators: WithRightIndicators, @Derived val dataDefinition: InStatementDataDefinition? = null, @@ -1712,13 +1712,15 @@ data class ScanStmt( ) : Statement(position), WithRightIndicators by rightIndicators, StatementThatCanDefineData { override fun execute(interpreter: InterpreterCore) { + val start = startPosition?.let { interpreter.eval(it).asString().value.toInt() } ?: 1 + val stringToSearch = interpreter.eval(left).asString().value.substringOfLength(leftLength) - val searchInto = interpreter.eval(right).asString().value.substring(startPosition - 1) + val searchInto = interpreter.eval(right).asString().value.substring(start - 1) val occurrences = mutableListOf() var index = -1 do { index = searchInto.indexOf(stringToSearch, index + 1) - if (index >= 0) occurrences.add(IntValue((index + startPosition).toLong())) + if (index >= 0) occurrences.add(IntValue((index + start).toLong())) } while (index >= 0) if (occurrences.isEmpty()) { interpreter.setIndicators(this, BooleanValue.FALSE, BooleanValue.FALSE, BooleanValue.FALSE) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt index cbc2f9014..fd6dc60c2 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt @@ -1316,20 +1316,31 @@ internal fun CsDELETEContext.toAst(conf: ToAstConfiguration): Statement { internal fun CsSCANContext.toAst(conf: ToAstConfiguration = ToAstConfiguration()): ScanStmt { val position = toPosition(conf.considerPosition) + val (compareExpression, compareLength) = this.factor1Context().toIndexedExpression(conf) - val (baseExpression, startPosition) = this.cspec_fixed_standard_parts().factor2.toIndexedExpression(conf) + + val factor2 = this.cspec_fixed_standard_parts().factor2 + + val result = this.cspec_fixed_standard_parts().result + val dataDefinition = this.cspec_fixed_standard_parts().toDataDefinition(result.text, position, conf) + val rightIndicators = cspec_fixed_standard_parts().rightIndicators() - val result = this.cspec_fixed_standard_parts().result.text - val dataDefinition = this.cspec_fixed_standard_parts().toDataDefinition(result, position, conf) - val target = when { - result.isNotBlank() -> this.cspec_fixed_standard_parts()!!.result!!.toAst(conf) - else -> null - } + val target = if (result.text.isNotBlank()) result.toAst(conf) else null + + val baseExpression = factor2.factorContent(0).toAst(conf) + // and "B" is the start position to substring, if not specified it returns null + val positionExpression = + if (factor2.factorContent().size > 1) { + factor2.factorContent(1).toAst(conf) + } else { + null + } + return ScanStmt( left = compareExpression, leftLength = compareLength, right = baseExpression, - startPosition = startPosition ?: 1, + startPosition = positionExpression, target = target, rightIndicators = rightIndicators, dataDefinition = dataDefinition, @@ -1378,8 +1389,6 @@ private fun FactorContext.toIndexedExpression(conf: ToAstConfiguration): Pair { - fun String.isLiteral(): Boolean { return (startsWith('\'') && endsWith('\'')) } - val baseStringTokens = this.split(":") val startPosition = when (baseStringTokens.size) { @@ -1389,7 +1398,10 @@ private fun String.toIndexedExpression(position: Position?): Pair StringLiteral(reference.trim('\''), position) + reference.isStringLiteral() -> StringLiteral(reference.trim('\''), position) + reference.contains('(') && reference.endsWith(")") -> { + annidatedReferenceExpression(this, position) + } else -> DataRefExpr(ReferenceByName(reference), position) } to startPosition } @@ -2024,3 +2036,5 @@ private fun List.removeUnnecessaryRecordFormat() dataDef.type is RecordFormatType && this.any { it.type is DataStructureType && it.name.uppercase() == dataDef.name.uppercase() } } } + +private fun String.isStringLiteral(): Boolean = startsWith('\'') && endsWith('\'') \ No newline at end of file From 01571bc21efcc5e1ddfb742dcafcb5d2ba11c951 Mon Sep 17 00:00:00 2001 From: Domenico Date: Thu, 14 Mar 2024 14:22:50 +0100 Subject: [PATCH 03/10] Add unit test T10_A20_P52 --- .../evaluation/SmeupInterpreterTest.kt | 6 ++++ .../test/resources/smeup/T10_A20_P52.rpgle | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 rpgJavaInterpreter-core/src/test/resources/smeup/T10_A20_P52.rpgle diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt index cbc19d86b..4d3ec749b 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt @@ -647,4 +647,10 @@ open class SmeupInterpreterTest : AbstractTest() { val expected = listOf("TestProcedura_Ritorno") assertEquals(expected, "smeup/T18_A10_P02".outputOf()) } + + @Test + fun executeT10_A20_P52() { + val expected = listOf("A20_N73(2.272) A20_N70(0) A20_N112(11.11) A20_N110(0) A20_N309(4.889964788)") + assertEquals(expected, "smeup/T10_A20_P52".outputOf(configuration = smeupConfig)) + } } \ No newline at end of file diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A20_P52.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A20_P52.rpgle new file mode 100644 index 000000000..932244957 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/T10_A20_P52.rpgle @@ -0,0 +1,28 @@ + D £DBG_Str S 150 VARYING + + D A20_N70 S 20P 0 + D A20_N73 S 20P 3 + D A20_N110 S 11P 0 + D A20_N112 S 11P 2 + D A20_N309 S 30P 9 + + C EXSR SUB_A20_I + C EVAL £DBG_Str='A20_N73('+%CHAR(A20_N73)+')' + C +' A20_N70('+%CHAR(A20_N70)+')' + C +' A20_N112('+%CHAR(A20_N112)+')' + C +' A20_N110('+%CHAR(A20_N110)+')' + C +' A20_N309('+%CHAR(A20_N309)+')' + + C £DBG_Str DSPLY + + *--------------------------------------------------------------------- + C SUB_A20_I BEGSR + * + C SETOFF 22 + C SETON 23 + C N2225 DIV 11 A20_N73 + C N22 MVR A20_N70 + C 23100 DIV 9 A20_N112 + C 23 MVR A20_N110 + C A20_N112 DIV A20_N73 A20_N309 + C ENDSR From 45cc2e92a6f2b77de3b5f1a91f4253147d42111d Mon Sep 17 00:00:00 2001 From: Domenico Date: Thu, 14 Mar 2024 14:23:14 +0100 Subject: [PATCH 04/10] Extend MVR parsing to allow for indicators --- rpgJavaInterpreter-core/src/main/antlr/RpgParser.g4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpgJavaInterpreter-core/src/main/antlr/RpgParser.g4 b/rpgJavaInterpreter-core/src/main/antlr/RpgParser.g4 index c94e52bc6..a6c37a809 100644 --- a/rpgJavaInterpreter-core/src/main/antlr/RpgParser.g4 +++ b/rpgJavaInterpreter-core/src/main/antlr/RpgParser.g4 @@ -1496,8 +1496,8 @@ csMULT: csMVR: CS_FIXED BlankIndicator - BlankFlag - BlankIndicator + (BlankFlag | NoFlag) + (BlankIndicator | GeneralIndicator) CS_BlankFactor operation=OP_MVR cspec_fixed_standard_parts; From 52db12ec9bfb6ccbc8a7f957aa7356bfec6375b7 Mon Sep 17 00:00:00 2001 From: Domenico Date: Thu, 14 Mar 2024 14:45:17 +0100 Subject: [PATCH 05/10] Cleanup --- .../kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt index fd6dc60c2..82fecba6b 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt @@ -1328,7 +1328,6 @@ internal fun CsSCANContext.toAst(conf: ToAstConfiguration = ToAstConfiguration() val target = if (result.text.isNotBlank()) result.toAst(conf) else null val baseExpression = factor2.factorContent(0).toAst(conf) - // and "B" is the start position to substring, if not specified it returns null val positionExpression = if (factor2.factorContent().size > 1) { factor2.factorContent(1).toAst(conf) From e79ad489ba2b476a0a5cd5fb68996e701648f6dc Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Fri, 15 Mar 2024 09:18:28 +0100 Subject: [PATCH 06/10] Implemented test --- .../smeup/rpgparser/evaluation/SmeupInterpreterTest.kt | 6 ++++++ .../src/test/resources/smeup/T02_A80_P01.rpgle | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 rpgJavaInterpreter-core/src/test/resources/smeup/T02_A80_P01.rpgle diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt index 9edd3ab72..943dd8282 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt @@ -653,4 +653,10 @@ open class SmeupInterpreterTest : AbstractTest() { val expected = listOf("123") assertEquals(expected, "smeup/T02_A80_P03".outputOf()) } + + @Test + fun executeT02_A80_P01() { + val expected = listOf("ABCDEFGHIJ12345") + assertEquals(expected, "smeup/T02_A80_P01".outputOf()) + } } \ No newline at end of file diff --git a/rpgJavaInterpreter-core/src/test/resources/smeup/T02_A80_P01.rpgle b/rpgJavaInterpreter-core/src/test/resources/smeup/T02_A80_P01.rpgle new file mode 100644 index 000000000..6ae94378e --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/smeup/T02_A80_P01.rpgle @@ -0,0 +1,10 @@ + D A80_A10 S 10 + D A80_N50 S 5 0 + D £DBG_Str S 50 VARYING + + C CLEAR A80_A10 10 + C CLEAR A80_N50 5 0 + C EVAL A80_A10 = 'ABCDEFGHIJ' + C EVAL A80_N50 = 12345 + C EVAL £DBG_Str=%TRIM(A80_A10)+%CHAR(A80_N50) + C £DBG_Str DSPLY \ No newline at end of file From 229b1953107b86730cc2fb5064b3e629614c1f43 Mon Sep 17 00:00:00 2001 From: Domenico Date: Tue, 19 Mar 2024 08:27:40 +0100 Subject: [PATCH 07/10] Move test to MULANGT10BaseCodopTest --- .../rpgparser/evaluation/SmeupInterpreterTest.kt | 6 ------ .../rpgparser/smeup/MULANGT10BaseCodopTest.kt | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt index 5b7da5187..afeae5b9c 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt @@ -678,10 +678,4 @@ open class SmeupInterpreterTest : AbstractTest() { val expected = listOf("Lunghezza: 32580 Contenuto: - - - - - - -") assertEquals(expected, "smeup/T40_A30_P01".outputOf(configuration = smeupConfig)) } - - @Test - fun executeT10_A20_P52() { - val expected = listOf("A20_N73(2.272) A20_N70(0) A20_N112(11.11) A20_N110(0) A20_N309(4.889964788)") - assertEquals(expected, "smeup/T10_A20_P52".outputOf(configuration = smeupConfig)) - } } \ No newline at end of file diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt index 9d46c6f12..bd7521a70 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt @@ -1,3 +1,16 @@ package com.smeup.rpgparser.smeup -open class MULANGT10BaseCodopTest : MULANGTTest() \ No newline at end of file +import org.junit.Test +import kotlin.test.assertEquals + +open class MULANGT10BaseCodopTest : MULANGTTest() { + /** + * DIV e MVR con indicatori + * @see #245 + */ + @Test + fun executeT10_A20_P52() { + val expected = listOf("A20_N73(2.272) A20_N70(0) A20_N112(11.11) A20_N110(0) A20_N309(4.889964788)") + assertEquals(expected, "smeup/T10_A20_P52".outputOf(configuration = smeupConfig)) + } +} \ No newline at end of file From 5edf31064064fcd8b6e55fc17fa91ae0fed1470d Mon Sep 17 00:00:00 2001 From: Domenico Date: Tue, 19 Mar 2024 13:09:36 +0100 Subject: [PATCH 08/10] Update test description --- .../kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt index bd7521a70..61423f3eb 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt @@ -5,7 +5,7 @@ import kotlin.test.assertEquals open class MULANGT10BaseCodopTest : MULANGTTest() { /** - * DIV e MVR con indicatori + * DIV and MVR with indicators * @see #245 */ @Test From 3ee154953a81fbe4c1d5003ecdc55b2d597666c5 Mon Sep 17 00:00:00 2001 From: Domenico Date: Tue, 19 Mar 2024 13:15:14 +0100 Subject: [PATCH 09/10] Move unit tests to MULANGT10BaseCodopTest --- .../evaluation/SmeupInterpreterTest.kt | 12 --------- .../rpgparser/smeup/MULANGT10BaseCodopTest.kt | 25 ++++++++++++++++++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt index f9fe3310b..afeae5b9c 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/evaluation/SmeupInterpreterTest.kt @@ -621,18 +621,6 @@ open class SmeupInterpreterTest : AbstractTest() { assertEquals(expected, "smeup/T10_A20_P47".outputOf()) } - @Test - fun executeT10_A35_P08() { - val expected = listOf("A35_AR1(2)(123&5) IN45(1)") - assertEquals(expected, "smeup/T10_A35_P08".outputOf(configuration = smeupConfig)) - } - - @Test - fun executeT10_A35_P10() { - val expected = listOf("A35_AR2(01)(5) A35_AR2(02)(6) A35_AR2(03)(0) IN20(1)") - assertEquals(expected, "smeup/T10_A35_P10".outputOf(configuration = smeupConfig)) - } - @Test fun executeT18_A10_P01() { val expected = listOf("Ritorno_Procedura") diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt index 9d46c6f12..0b10a127e 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT10BaseCodopTest.kt @@ -1,3 +1,26 @@ package com.smeup.rpgparser.smeup -open class MULANGT10BaseCodopTest : MULANGTTest() \ No newline at end of file +import org.junit.Test +import kotlin.test.assertEquals + +open class MULANGT10BaseCodopTest : MULANGTTest() { + /** + * SCAN with array in input + * @see #218 + */ + @Test + fun executeT10_A35_P08() { + val expected = listOf("A35_AR1(2)(123&5) IN45(1)") + assertEquals(expected, "smeup/T10_A35_P08".outputOf(configuration = smeupConfig)) + } + + /** + * SCAN with array in result + * @see #244 + */ + @Test + fun executeT10_A35_P10() { + val expected = listOf("A35_AR2(01)(5) A35_AR2(02)(6) A35_AR2(03)(0) IN20(1)") + assertEquals(expected, "smeup/T10_A35_P10".outputOf(configuration = smeupConfig)) + } +} \ No newline at end of file From d3cd7a2f8cdf9d8d0228d89a7811d6454c9bd5ce Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Tue, 19 Mar 2024 14:03:49 +0100 Subject: [PATCH 10/10] Fixed comments --- .../com/smeup/rpgparser/smeup/MULANGT02ConstAndDSpecTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT02ConstAndDSpecTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT02ConstAndDSpecTest.kt index f69d2c890..8c630cf1a 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT02ConstAndDSpecTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/smeup/MULANGT02ConstAndDSpecTest.kt @@ -5,7 +5,7 @@ import kotlin.test.assertEquals open class MULANGT02ConstAndDSpecTest : MULANGTTest() { /** - * Data reference - Definizione inline e in specifiche D + * Data reference - Inline definition * @see #250 */ @Test