Skip to content

Commit

Permalink
split T04_15 into 3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cosentino-smeup committed Feb 13, 2024
1 parent 92bfc5c commit 9a6e99b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ open class SmeupInterpreterTest : AbstractTest() {
}

@Test
fun executeT04_A15() {
fun executeT04_A15_P01() {
val expected = listOf<String>(
"P01_01(8)",
"P01_02(13)",
Expand All @@ -334,13 +334,27 @@ open class SmeupInterpreterTest : AbstractTest() {
"P01_09(2)",
"P01_10(1)",
"P01_11(2)",
"P01_12(0)",
"P01_12(0)"
)
assertEquals(expected, "smeup/T04_A15_P01".outputOf())
}

@Test
fun executeT04_A15_P02() {
val expected = listOf<String>(
"P02_01(10)",
"P02_02(6)",
"P02_02(6)"
)
assertEquals(expected, "smeup/T04_A15_P02".outputOf())
}

@Test
fun executeT04_A15_P03() {
val expected = listOf<String>(
"P03_01(0)",
"P03_02(1)",
"P03_03(ok)"
)
assertEquals(expected, "smeup/T04_A15".outputOf())
assertEquals(expected, "smeup/T04_A15_P03".outputOf())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
D pos S 5U 0
D £DBG_Str S 30
D £DBG_Pas S 3
D alphabet C 'ABCDEFGHIJKLMNOPQRSTUVWXYZ +
D abcdefghijklmnopqrstuvwxyz +
D 0123456789+/'
*
C EXSR SEZ_T04_A15
*
C SETON LR
*---------------------------------------------------------------
RD* Errori programma MULANGT04 sezione A15
*--------------------------------------------------------------*
C SEZ_T04_A15 BEGSR
OA* A&.BIFN(%CHECK)
D* %CHECK semplice
C EVAL £DBG_Pas='P01'
*
C EVAL name = ' Amit Jaiswal'
Expand Down Expand Up @@ -78,40 +65,4 @@
C EVAL £DBG_Str='P01_12('+%char(pos)+')'
C £DBG_Str DSPLY
*
OA* A&.BIFN(%CHECK)
D* %CHECK con posizione
C EVAL £DBG_Pas='P02'
*
C EVAL name = 'Amit Jaiswal'
C EVAL pos = %check('Jais' : name:6)
C EVAL £DBG_Str='P02_01('+%char(pos)+')'
C £DBG_Str DSPLY
*
C EVAL name = 'Amit Jaiswal'
C EVAL pos = %check('A' : name:6)
C EVAL £DBG_Str='P02_02('+%char(pos)+')'
C £DBG_Str DSPLY
*
*
OA* A&.BIFN(%CHECK)
D* %CHECK ricerca in alfabeto
C EVAL £DBG_Pas='P03'
*
C EVAL name = 'Amit Jaiswal'
C EVAL pos = %check(alphabet: name)
C EVAL £DBG_Str='P03_01('+%char(pos)+')'
C £DBG_Str DSPLY
*
C EVAL name = '££ t abc1234'
C EVAL pos = %check(alphabet: name)
C EVAL £DBG_Str='P03_02('+%char(pos)+')'
C £DBG_Str DSPLY
*
C IF %CHECK(alphabet: 'Antonio Cosentino')= 0
C EVAL £DBG_Str='P03_03(ok)'
C ELSE
C EVAL £DBG_Str='P03_03(ko)'
C ENDIF
C £DBG_Str DSPLY
*
C ENDSR
C SETON LR
18 changes: 18 additions & 0 deletions rpgJavaInterpreter-core/src/test/resources/smeup/T04_A15_P02.rpgle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
D name S 30A
D pos S 5U 0
D £DBG_Str S 30
D £DBG_Pas S 3
*
C EVAL £DBG_Pas='P02'
*
C EVAL name = 'Amit Jaiswal'
C EVAL pos = %check('Jais' : name:6)
C EVAL £DBG_Str='P02_01('+%char(pos)+')'
C £DBG_Str DSPLY
*
C EVAL name = 'Amit Jaiswal'
C EVAL pos = %check('A' : name:6)
C EVAL £DBG_Str='P02_02('+%char(pos)+')'
C £DBG_Str DSPLY
*
C SETON LR
28 changes: 28 additions & 0 deletions rpgJavaInterpreter-core/src/test/resources/smeup/T04_A15_P03.rpgle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
D name S 30A
D pos S 5U 0
D £DBG_Str S 30
D £DBG_Pas S 3
D alphabet C 'ABCDEFGHIJKLMNOPQRSTUVWXYZ +
D abcdefghijklmnopqrstuvwxyz +
D 0123456789+/'
*
C EVAL £DBG_Pas='P03'
*
C EVAL name = 'Amit Jaiswal'
C EVAL pos = %check(alphabet: name)
C EVAL £DBG_Str='P03_01('+%char(pos)+')'
C £DBG_Str DSPLY
*
C EVAL name = '££ t abc1234'
C EVAL pos = %check(alphabet: name)
C EVAL £DBG_Str='P03_02('+%char(pos)+')'
C £DBG_Str DSPLY
*
C IF %CHECK(alphabet: 'Antonio Cosentino')= 0
C EVAL £DBG_Str='P03_03(ok)'
C ELSE
C EVAL £DBG_Str='P03_03(ko)'
C ENDIF
C £DBG_Str DSPLY
*
C SETON LR

0 comments on commit 9a6e99b

Please sign in to comment.