Commit 8ab7270a authored by pfdietz's avatar pfdietz

More string trimming tests (string designators other than strings, and some corner cases.)

parent 33ae1dc1
......@@ -106,3 +106,37 @@
(values s s2))
"abcdaba"
"cdaba")
;;; Test that trimming is case sensitive
(deftest string-left-trim.13
(let* ((s (copy-seq "aA"))
(s2 (string-left-trim "a" s)))
(values s s2))
"aA" "A")
(deftest string-left-trim.14
(let* ((s '|abcdaba|)
(s2 (string-left-trim "ab" s)))
(values (symbol-name s) s2))
"abcdaba"
"cdaba")
(deftest string-left-trim.15
(string-left-trim "abc" "")
"")
(deftest string-left-trim.16
(string-left-trim "a" #\a)
"")
(deftest string-left-trim.17
(string-left-trim "b" #\a)
"a")
(deftest string-left-trim.18
(string-left-trim "" (copy-seq "abcde"))
"abcde")
(deftest string-left-trim.19
(string-left-trim "abc" (copy-seq "abcabcabc"))
"")
......@@ -106,3 +106,38 @@
(values s s2))
"abcdaba"
"abcd")
;;; Test that trimming is case sensitive
(deftest string-right-trim.13
(let* ((s (copy-seq "Aa"))
(s2 (string-right-trim "a" s)))
(values s s2))
"Aa" "A")
(deftest string-right-trim.14
(let* ((s '|abcdaba|)
(s2 (string-right-trim "ab" s)))
(values (symbol-name s) s2))
"abcdaba"
"abcd")
(deftest string-right-trim.15
(string-right-trim "abc" "")
"")
(deftest string-right-trim.16
(string-right-trim "a" #\a)
"")
(deftest string-right-trim.17
(string-right-trim "b" #\a)
"a")
(deftest string-right-trim.18
(string-right-trim "" (copy-seq "abcde"))
"abcde")
(deftest string-right-trim.19
(string-right-trim "abc" (copy-seq "abcabcabc"))
"")
......@@ -106,3 +106,42 @@
(values s s2))
"abcdaba"
"cd")
;;; Test that trimming is case sensitive
(deftest string-trim.13
(let* ((s (copy-seq "Aa"))
(s2 (string-trim "a" s)))
(values s s2))
"Aa" "A")
(deftest string-trim.14
(let* ((s '|abcdaba|)
(s2 (string-trim "ab" s)))
(values (symbol-name s) s2))
"abcdaba"
"cd")
(deftest string-trim.15
(string-trim "abc" "")
"")
(deftest string-trim.16
(string-trim "a" #\a)
"")
(deftest string-trim.17
(string-trim "b" #\a)
"a")
(deftest string-trim.18
(string-trim "" (copy-seq "abcde"))
"abcde")
(deftest string-trim.19
(string-trim "abc" (copy-seq "abcabcabc"))
"")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment