Skip to content

Commit

Permalink
Merge branch 'develop' into feature/LS24005347/missing-found
Browse files Browse the repository at this point in the history
  • Loading branch information
dom-apuliasoft committed Dec 12, 2024
2 parents d4507ec + 82386f7 commit 8640b04
Show file tree
Hide file tree
Showing 9 changed files with 303 additions and 4 deletions.
18 changes: 16 additions & 2 deletions kolasu/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2019 Sme.UP S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

//-----------------
//kolasu build script
//-----------------
Expand Down Expand Up @@ -42,8 +58,6 @@ dependencies {
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"

implementation 'com.fifesoft:rsyntaxtextarea:3.5.2'
implementation 'com.fifesoft:autocomplete:3.3.1'
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-cbor:$serializationVersion"

Expand Down
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 @@ -831,6 +831,84 @@ open class MULANGT10BaseCodopTest : MULANGTTest() {
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))
}

/**
* SCAN followed by %FOUND
* @see #LS24005347
Expand Down
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

0 comments on commit 8640b04

Please sign in to comment.