aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-20 11:02:36 +0000
committer_ov4 <ov4@ov4.org>2026-10-20 11:02:36 +0000
commit496c020541d4d35e5800b813b3f8d113a8f2b90b (patch)
tree938a85ff36482af576ecbdd9cd3745ee6d25a336 /tests
parenta1ba45b28c94244d2e1c6f00372d51d294cc3edc (diff)
feat(library): add experimental string UCASE overloads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/library/exp-string/expected.txt5
-rw-r--r--tests/library/exp-string/notes.md2
-rw-r--r--tests/library/exp-string/program.cps14
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/library/exp-string/expected.txt b/tests/library/exp-string/expected.txt
index f5eda62..b7e35f6 100644
--- a/tests/library/exp-string/expected.txt
+++ b/tests/library/exp-string/expected.txt
@@ -27,3 +27,8 @@ AbC@19
w:w:@
0:8
abc
+ABC@19
+AbC@19
+H:H:@
+0:8
+ABC
diff --git a/tests/library/exp-string/notes.md b/tests/library/exp-string/notes.md
index 47fb6ca..d365dfc 100644
--- a/tests/library/exp-string/notes.md
+++ b/tests/library/exp-string/notes.md
@@ -13,3 +13,5 @@ The added checks use separate procedures to keep generated temporary-object clea
MID positions 2..4 give BCD. The minimum INTEGER start clamps to 1 and gives AB; a maximum count from position 7 gives GH. Empty input, a maximum start, and nonpositive counts give length zero. Four bytes starting at the second of three NULs retain two NULs and AB.
LCASE converts AbC@19 to abc@19 without modifying the source. Its CHAR overload returns CHAR w for W or w and preserves @, as in guide section 5.5. Empty length stays zero; two leading NULs survive conversion and letters after them still become abc.
+
+UCASE converts AbC@19 to ABC@19 without modifying the source. Its CHAR overload returns CHAR H for h or H and preserves @, as in guide section 5.5. Empty length stays zero; two leading NULs survive conversion and letters after them still become ABC.
diff --git a/tests/library/exp-string/program.cps b/tests/library/exp-string/program.cps
index 2e041ec..61a915c 100644
--- a/tests/library/exp-string/program.cps
+++ b/tests/library/exp-string/program.cps
@@ -43,6 +43,7 @@ CALL CheckLeft()
CALL CheckRight()
CALL CheckMid()
CALL CheckLCase()
+CALL CheckUCase()
PROCEDURE CheckLeft()
DECLARE Letters : _EXP_STRING((C_STRING)"ABCDEFGH")
@@ -90,3 +91,16 @@ PROCEDURE CheckLCase()
OUTPUT _EXP_STRING_LENGTH(_EXP_STRING_LCASE(Empty)), ":", _EXP_STRING_LENGTH(_EXP_STRING_LCASE(Nuls & Mixed))
CALL _EXP_STRING_OUTPUT(_EXP_STRING_MID(_EXP_STRING_LCASE(Nuls & Mixed), 3, 3))
ENDPROCEDURE
+
+PROCEDURE CheckUCase()
+ DECLARE Mixed : _EXP_STRING((C_STRING)"AbC@19")
+ DECLARE Empty : _EXP_STRING
+ DECLARE Nuls : _EXP_STRING(2, (C_CHAR)'\0')
+ CALL _EXP_STRING_OUTPUT(_EXP_STRING_UCASE(Mixed))
+ CALL _EXP_STRING_OUTPUT(Mixed)
+ DECLARE Upper : CHAR
+ Upper <- _EXP_STRING_UCASE('h')
+ OUTPUT Upper, ":", _EXP_STRING_UCASE('H'), ":", _EXP_STRING_UCASE('@')
+ OUTPUT _EXP_STRING_LENGTH(_EXP_STRING_UCASE(Empty)), ":", _EXP_STRING_LENGTH(_EXP_STRING_UCASE(Nuls & Mixed))
+ CALL _EXP_STRING_OUTPUT(_EXP_STRING_MID(_EXP_STRING_UCASE(Nuls & Mixed), 3, 3))
+ENDPROCEDURE