aboutsummaryrefslogtreecommitdiff
path: root/tests/library/exp-string/program.cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-20 11:04:39 +0000
committer_ov4 <ov4@ov4.org>2026-10-20 11:04:39 +0000
commit52e0674c54d4b53b2132e750106cc9acb266ed39 (patch)
tree9d605a6ca2bd6aa894dc46e18dc86da8298bf61d /tests/library/exp-string/program.cps
parent8975d167c849f54664be8d5da418cd909694d26f (diff)
feat(library): add experimental string IS_NUM function
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/library/exp-string/program.cps')
-rw-r--r--tests/library/exp-string/program.cps13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/library/exp-string/program.cps b/tests/library/exp-string/program.cps
index e789e54..0adf86c 100644
--- a/tests/library/exp-string/program.cps
+++ b/tests/library/exp-string/program.cps
@@ -46,6 +46,7 @@ CALL CheckLCase()
CALL CheckUCase()
CALL CheckAsc()
CALL CheckChr()
+CALL CheckIsNum()
PROCEDURE CheckLeft()
DECLARE Letters : _EXP_STRING((C_STRING)"ABCDEFGH")
@@ -123,3 +124,15 @@ PROCEDURE CheckChr()
OUTPUT _EXP_STRING_LENGTH(_EXP_STRING_CHR(0)), ":", _EXP_STRING_ASC(_EXP_STRING_CHR(0))
OUTPUT _EXP_STRING_ASC(_EXP_STRING_CHR(321)), ":", _EXP_STRING_ASC(_EXP_STRING_CHR(-1))
ENDPROCEDURE
+
+PROCEDURE CheckIsNum()
+ DECLARE Number : _EXP_STRING((C_STRING)"12.5")
+ DECLARE Junk : _EXP_STRING((C_STRING)"12x")
+ DECLARE Empty : _EXP_STRING
+ DECLARE Leading : _EXP_STRING((C_STRING)" 12.5")
+ DECLARE Trailing : _EXP_STRING((C_STRING)"12.5 ")
+ DECLARE Whitespace : _EXP_STRING((C_STRING)" ")
+ OUTPUT _EXP_STRING_IS_NUM(Number), ":", _EXP_STRING_IS_NUM(Junk), ":", _EXP_STRING_IS_NUM(Empty)
+ OUTPUT _EXP_STRING_IS_NUM(Leading), ":", _EXP_STRING_IS_NUM(Trailing), ":", _EXP_STRING_IS_NUM(Whitespace)
+ OUTPUT _EXP_STRING_IS_NUM(Number & _EXP_STRING_CHR(0)), ":", _EXP_STRING_IS_NUM(_EXP_STRING_CHR(0) & Number)
+ENDPROCEDURE