Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/LS24005329/Improve comparison between *HIVAL and String #683

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8df0094
Added `MUDRNRAPU00183` which works
davidepalladino-apuliasoft Dec 10, 2024
3e90248
Improved `MUDRNRAPU00183` by adding `*HIVAL` at right side
davidepalladino-apuliasoft Dec 10, 2024
3e188a5
Typo
davidepalladino-apuliasoft Dec 10, 2024
303349b
Added `MUDRNRAPU00184` to compare `*HIVAL` as greater than other.
davidepalladino-apuliasoft Dec 10, 2024
7673ec8
Applied fix for `MUDRNRAPU00184`
davidepalladino-apuliasoft Dec 10, 2024
6f82e65
Added `MUDRNRAPU00185` to compare `*HIVAL` as greater/equal than othe…
davidepalladino-apuliasoft Dec 10, 2024
93744d6
Added `MUDRNRAPU00186` to compare `*HIVAL` as lower than other, which…
davidepalladino-apuliasoft Dec 10, 2024
1d411e5
Added `MUDRNRAPU00187` to compare `*HIVAL` as lower/equal than other,…
davidepalladino-apuliasoft Dec 10, 2024
fc6b882
Changed name of variable for each test
davidepalladino-apuliasoft Dec 10, 2024
2b00a54
Improved `MUDRNRAPU00183` by adding same comparison but with another …
davidepalladino-apuliasoft Dec 10, 2024
1c102bc
Improved `MUDRNRAPU00184` by adding same comparison but with another …
davidepalladino-apuliasoft Dec 10, 2024
59265d2
Improved `MUDRNRAPU00185` by adding same comparison but with another …
davidepalladino-apuliasoft Dec 10, 2024
97110a8
Improved `MUDRNRAPU00186` by adding same comparison but with another …
davidepalladino-apuliasoft Dec 10, 2024
4d6a115
Fixed second array initialization
davidepalladino-apuliasoft Dec 10, 2024
1888c9d
Improved `MUDRNRAPU00187` by adding same comparison but with another …
davidepalladino-apuliasoft Dec 10, 2024
e507ed0
Implemented `MUDRNRAPU00188` which test a comparison, with "equal" op…
davidepalladino-apuliasoft Dec 10, 2024
a9c98d4
Using constants instead numeric value
davidepalladino-apuliasoft Dec 10, 2024
e1926d5
Fixed error after Kotlin Check
davidepalladino-apuliasoft Dec 10, 2024
e237706
Merged develep
davidepalladino-apuliasoft Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ data class StringValue(var value: String, var varying: Boolean = false) : Abstra
override operator fun compareTo(other: Value): Int =
when (other) {
is StringValue -> compare(other, DEFAULT_CHARSET)
is HiValValue -> if (this == this.hiValue()) EQUAL else SMALLER
is BlanksValue -> if (this.isBlank()) EQUAL else SMALLER
is BooleanValue -> if (this.value.isInt() && this.value.toInt() == other.value.toInt()) EQUAL else GREATER
else -> super.compareTo(other)
Expand Down Expand Up @@ -801,8 +802,13 @@ object HiValValue : Value {

override fun copy(): HiValValue = this

override operator fun compareTo(other: Value): Int =
if (other is HiValValue) 0 else 1
override operator fun compareTo(other: Value): Int {
return when (other) {
is StringValue -> if (other.hiValue() == other) EQUAL else GREATER
// TODO: Is much generic. Provide atomic cases.
else -> if (other is HiValValue) EQUAL else GREATER
}
}

override fun asString(): StringValue {
TODO("Not yet implemented")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,4 +830,82 @@ open class MULANGT10BaseCodopTest : MULANGTTest() {
val expected = listOf("", "FOO", "BAR", "BARX")
assertEquals(expected, "smeup/MUDRNRAPU00182".outputOf(configuration = smeupConfig))
}

/**
* Comparison between:
* - *HIVAL and String,
* - *HIVAL and *HIVAL
* by using "not equal" operator.
* @see #LS24005329
*/
@Test
fun executeMUDRNRAPU00183() {
val expected = listOf("TRUE", "END", "TRUE", "END", "END", "END")
assertEquals(expected, "smeup/MUDRNRAPU00183".outputOf(configuration = smeupConfig))
}

/**
* Comparison between:
* - *HIVAL and String,
* - *HIVAL and *HIVAL
* by using "greater" operator.
* @see #LS24005329
*/
@Test
fun executeMUDRNRAPU00184() {
val expected = listOf("TRUE", "END", "TRUE", "END", "END", "END")
assertEquals(expected, "smeup/MUDRNRAPU00184".outputOf(configuration = smeupConfig))
}

/**
* Comparison between:
* - *HIVAL and String,
* - *HIVAL and *HIVAL
* by using "greater/equal" operator.
* @see #LS24005329
*/
@Test
fun executeMUDRNRAPU00185() {
val expected = listOf("TRUE", "END", "TRUE", "END", "TRUE", "END", "TRUE", "END")
assertEquals(expected, "smeup/MUDRNRAPU00185".outputOf(configuration = smeupConfig))
}

/**
* Comparison between:
* - *HIVAL and String,
* - *HIVAL and *HIVAL
* by using "lower" operator.
* @see #LS24005329
*/
@Test
fun executeMUDRNRAPU00186() {
val expected = listOf("END", "END", "END", "END")
assertEquals(expected, "smeup/MUDRNRAPU00186".outputOf(configuration = smeupConfig))
}

/**
* Comparison between:
* - *HIVAL and String,
* - *HIVAL and *HIVAL
* by using "lower/equal" operator.
* @see #LS24005329
*/
@Test
fun executeMUDRNRAPU00187() {
val expected = listOf("END", "END", "TRUE", "END", "TRUE", "END")
assertEquals(expected, "smeup/MUDRNRAPU00187".outputOf(configuration = smeupConfig))
}

/**
* Comparison between:
* - *HIVAL as Standalone of 2 chars,
* - *HIVAL as Standalone of 4 chars,
* by using "equal" operator.
* @see #LS24005329
*/
@Test
fun executeMUDRNRAPU00188() {
val expected = listOf("END")
assertEquals(expected, "smeup/MUDRNRAPU00188".outputOf(configuration = smeupConfig))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
V* ==============================================================
V* 10/12/2024 APU001 Creation
V* ==============================================================
O * PROGRAM GOAL
O * Comparison between:
O * - *HIVAL and String,
O * - *HIVAL and *HIVAL
O * by using "not equal" operator.
V* ==============================================================
O * JARIKO ANOMALY
O * The expression is not evaluated when it's true.
V* ==============================================================
D ARR01 S 2 DIM(10) INZ('FF')
D ARR02 S 2 DIM(10) INZ(*HIVAL)

C IF *HIVAL<>ARR01(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR01(1)<>*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF *HIVAL<>ARR02(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR02(1)<>*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C SETON LR
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
V* ==============================================================
V* 10/12/2024 APU001 Creation
V* ==============================================================
O * PROGRAM GOAL
O * Comparison between:
O * - *HIVAL and String,
O * - *HIVAL and *HIVAL
O * by using "greater" operator.
V* ==============================================================
O * JARIKO ANOMALY
O * The expression is not evaluated when it's true.
V* ==============================================================
D ARR01 S 2 DIM(10) INZ('FF')
D ARR02 S 2 DIM(10) INZ(*HIVAL)

C IF *HIVAL>ARR01(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR01(1)<*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF *HIVAL>ARR02(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR02(1)<*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C SETON LR
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
V* ==============================================================
V* 10/12/2024 APU001 Creation
V* ==============================================================
O * PROGRAM GOAL
O * Comparison between:
O * - *HIVAL and String,
O * - *HIVAL and *HIVAL
O * by using "greater/equal" operator.
V* ==============================================================
O * JARIKO ANOMALY
O * The expression is not evaluated when it's true.
V* ==============================================================
D ARR01 S 2 DIM(10) INZ('FF')
D ARR02 S 2 DIM(10) INZ(*HIVAL)

C IF *HIVAL>=ARR01(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR01(1)<=*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF *HIVAL>=ARR02(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR02(1)<=*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C SETON LR
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
V* ==============================================================
V* 10/12/2024 APU001 Creation
V* ==============================================================
O * PROGRAM GOAL
O * Comparison between:
O * - *HIVAL and String,
O * - *HIVAL and *HIVAL
O * by using "lower" operator.
V* ==============================================================
O * JARIKO ANOMALY
O * The expression is not evaluated when it's true.
V* ==============================================================
D ARR01 S 2 DIM(10) INZ('FF')
D ARR02 S 2 DIM(10) INZ(*HIVAL)

C IF *HIVAL<ARR01(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR01(1)>*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF *HIVAL<ARR02(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR02(1)>*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C SETON LR
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
V* ==============================================================
V* 10/12/2024 APU001 Creation
V* ==============================================================
O * PROGRAM GOAL
O * Comparison between:
O * - *HIVAL and String,
O * - *HIVAL and *HIVAL
O * by using "lower/equal" operator.
V* ==============================================================
O * JARIKO ANOMALY
O * The expression is not evaluated when it's true.
V* ==============================================================
D ARR01 S 2 DIM(10) INZ('FF')
D ARR02 S 2 DIM(10) INZ(*HIVAL)

C IF *HIVAL<=ARR01(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR01(1)>=*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF *HIVAL<=ARR02(1)
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C IF ARR02(1)>=*HIVAL
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C SETON LR
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
V* ==============================================================
V* 10/12/2024 APU001 Creation
V* ==============================================================
O * PROGRAM GOAL
O * Comparison between:
O * - *HIVAL as Standalone of 2 chars,
O * - *HIVAL as Standalone of 4 chars,
O * by using "equal" operator.
V* ==============================================================
O * JARIKO ANOMALY
O * The expression is not evaluated when it's true.
V* ==============================================================
D D1 S 2 INZ(*HIVAL)
D D2 S 4 INZ(*HIVAL)

C IF D1=D2
C 'TRUE' DSPLY
C ENDIF
C 'END' DSPLY

C SETON LR
Loading