Skip to content

Commit

Permalink
Updated error test. This concern ERROR52.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidepalladino-apuliasoft committed Feb 11, 2025
1 parent 6aa7f70 commit de869b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private fun moveaDataStructure(
value: Expression
): DataStructValue {
if (value is DataRefExpr && value.variable.referred?.type is ArrayType && (value.variable.referred?.type as ArrayType).element is NumberType) {
throw IllegalStateException("Factor 2 and Result aren't same type: ${value.render()} (${value.position})")
throw IllegalStateException("You cannot move a numeric array into a DS: ${value.render()} (${value.position})")
}

val targetValue: DataStructValue = interpreterCore.eval(target) as DataStructValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ class JarikoCallbackTest : AbstractTest() {
@Test
fun executeERROR52CallBackTest() {
executePgmCallBackTest("ERROR52", SourceReferenceType.Program, "ERROR52", mapOf(
13 to "Factor 2 and Result aren't same type: SCAATT (Position(start=Line 13, Column 35, end=Line 13, Column 43))"
13 to "You cannot move a numeric array into a DS: SCAATT (Position(start=Line 13, Column 35, end=Line 13, Column 41))"
))
}

Expand Down
2 changes: 1 addition & 1 deletion rpgJavaInterpreter-core/src/test/resources/ERROR52.rpgle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
D* 06/02/25
D* Purpose: Must fire the following errors during execution of
D* `C MOVEA SCAATT SCAATTDS`:
D* line 19 - "Factor 2 and Result aren't same type"
D* line 13 - "You cannot move a numeric array into a DS"
D* because isn't possible to assign Standalone defined
D* as number to a DS.
V* ==============================================================
Expand Down

0 comments on commit de869b2

Please sign in to comment.