diff options
| author | Mistivia <i@mistivia.com> | 2025-06-23 20:29:57 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-23 20:29:57 +0800 |
| commit | 15821fd796d3f1e1b14bbb4aa32715aab4f49c56 (patch) | |
| tree | 996f215d25d5897c3b666df4fdb48d198072b1d2 /tests/string.lisp | |
| parent | 69e9065635b1c20fe0f973bdebeb2745171bace1 (diff) | |
add string functions
Diffstat (limited to 'tests/string.lisp')
| -rw-r--r-- | tests/string.lisp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/string.lisp b/tests/string.lisp new file mode 100644 index 0000000..a55e558 --- /dev/null +++ b/tests/string.lisp @@ -0,0 +1,29 @@ +(assert (equal "abc" (string #\a #\b #\c))) +(assert (equal "ABC" (string 65 66 67))) + +(assert (string= "abc" (string #\a #\b #\c))) +(assert (string= "ABC" (string 65 66 67))) + +(defvar s1 "a1s") +(defvar s2 "a2s") + +(assert (string= s1 s1)) +(assert (string>= s1 s1)) +(assert (string<= s1 s1)) +(assert (string> s2 s1)) +(assert (string>= s2 s1)) +(assert (string< s1 s2)) +(assert (string<= s1 s2)) +(assert (string/= s1 s2)) + +(assert (not (string/= s1 s1))) +(assert (not (string< s1 s1))) +(assert (not (string> s1 s1))) +(assert (not (string<= s2 s1))) +(assert (not (string< s2 s1))) +(assert (not (string>= s1 s2))) +(assert (not (string> s1 s2))) + +(assert (string= "abc" (strip-string "\n\tabc \t\n"))) +(assert (equal ("a" "b" "c") (split-string "a,b,c" #\,))) + |
