Skip to content

Commit

Permalink
remove entry in tests/ChangeLog and separate the testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
ammaralmorsi committed Sep 6, 2024
1 parent 433c294 commit d6b6724
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
4 changes: 0 additions & 4 deletions tests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

2024-08-30 Ammar Almorsi <[email protected]>
* testsuite.src/run_ml.at: Added new test case to verify the correct
generation of nested XML attributes

2024-08-03 David Declerck <[email protected]>

* testsuite.src/run_file.at, testsuite.src/run_misc.at:
Expand Down
33 changes: 26 additions & 7 deletions tests/testsuite.src/run_ml.at
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ AT_DATA([prog.cob], [
05 name PIC X(10) value "Someone".
05 dept PIC X(10) value "Marketing".

01 NSTD.
05 ATT1 pic x(4) value "ATT1".
05 CHLD1.
10 NSTD_ATT1 pic x(9) value "NSTD_ATT1".
10 NSTD_ATT2 pic x(9) value "NSTD_ATT2".
05 ATT2 pic x(4) value "ATT2".

PROCEDURE DIVISION.
XML GENERATE out
FROM rec
Expand Down Expand Up @@ -124,7 +117,33 @@ AT_DATA([prog.cob], [
DISPLAY 'Test 10 failed: ' FUNCTION TRIM (out)
END-IF
.
])

AT_CHECK([$COMPILE -fnot-reserved=ID prog.cob], [0], [], [])
AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], [])
AT_CLEANUP


AT_SETUP([XML GENERATE WITH ATTRIBUTES])
AT_KEYWORDS([extensions])

AT_SKIP_IF([test "$COB_HAS_XML2" = "no"])

AT_DATA([prog.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 out PIC X(200).
01 NSTD.
05 ATT1 pic x(4) value "ATT1".
05 CHLD1.
10 NSTD_ATT1 pic x(9) value "NSTD_ATT1".
10 NSTD_ATT2 pic x(9) value "NSTD_ATT2".
05 ATT2 pic x(4) value "ATT2".

PROCEDURE DIVISION.
XML GENERATE out FROM NSTD WITH ATTRIBUTES
IF out <> '<NSTD ATT1="ATT1" ATT2="ATT2">'-
'<CHLD1 NSTD_ATT1="NSTD_ATT1" '-
Expand Down

0 comments on commit d6b6724

Please sign in to comment.