aboutsummaryrefslogtreecommitdiff
path: root/tests/library/exp-string/program.cps
diff options
context:
space:
mode:
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