From e88347bec4662ade0a432d1a3db72e54e6a793ec Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Fri, 23 Aug 2024 09:32:47 +0200 Subject: [PATCH] Add a `SEARCH ALL` test with non-0xff `HIGH-VALUE` --- tests/testsuite.src/run_misc.at | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/testsuite.src/run_misc.at b/tests/testsuite.src/run_misc.at index 51000153a..67eb1fb92 100644 --- a/tests/testsuite.src/run_misc.at +++ b/tests/testsuite.src/run_misc.at @@ -4003,6 +4003,38 @@ AT_CHECK([$COBCRUN_DIRECT ./ebcdic], [0], [], []) AT_CLEANUP +AT_SETUP([SEARCH ALL with non-0xff HIGH-VALUE]) +AT_KEYWORDS([runmisc default-colseq]) + +AT_DATA([prog.cob], [ + IDENTIFICATION DIVISION. + PROGRAM-ID. prog. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 TAB. + 02 TAB-ELT OCCURS 3 + ASCENDING KEY TAB-KEY + INDEXED BY TI. + 05 TAB-KEY PIC X. + PROCEDURE DIVISION. + MOVE HIGH-VALUE TO TAB + MOVE "1" TO TAB-ELT (1) + * DISPLAY "|" TAB "|" + SEARCH ALL TAB-ELT + AT END + DISPLAY '"1" NOT FOUND' + WHEN TAB-KEY (TI) = "1" + CONTINUE + END-SEARCH + STOP RUN. +]) + +AT_CHECK([$COMPILE -febcdic-table=ebcdic500_latin1 -fdefault-colseq=EBCDIC prog.cob], [0], [], []) +AT_CHECK([$COBCRUN_DIRECT ./prog], [0], [], []) + +AT_CLEANUP + + AT_SETUP([PIC ZZZ-, ZZZ+]) AT_KEYWORDS([runmisc editing])