Commit 9e1306f1 authored by pfdietz's avatar pfdietz

More specialized string tests

parent f41c0a4e
......@@ -597,6 +597,21 @@
(mismatch m a :from-end t)))
(4 4 5 nil nil 6 5 6))
(deftest mistmatch-string.25
(let ((s0 "12345")
(s1 "123A")
(s2 "245"))
(do-special-strings
(s s0 nil)
(assert (null (mismatch s s0)))
(assert (null (mismatch s0 s)))
(assert (null (mismatch s s0 :from-end t)))
(assert (null (mismatch s0 s :from-end t)))
(assert (eql (mismatch s s1) 3))
(assert (eql (mismatch s1 s) 3))
))
nil)
;;; test and test-not tests
(defharmless mismatch.test-and-test-not.1
......
......@@ -175,4 +175,23 @@
(let ((pat "m")
(target '"adgmnpq"))
(search pat target :test-not #'char>=))
4)
\ No newline at end of file
4)
;;; Specialized strings
(deftest search-string.19
(do-special-strings
(s "a" nil)
(assert (eql (search s "xyza123apqr") 3))
(assert (eql (search s "xyza1a3apqr" :start2 4) 5))
(assert (eql (search s "xyza123apqr" :from-end t) 7)))
nil)
(deftest search-string.20
(do-special-strings
(s "xababcdefabc123ababc18" nil)
(assert (eql (search "abc" s) 3))
(assert (eql (search "abc" s :start2 4) 9))
(assert (eql (search "abc" s :from-end t) 17)))
nil)
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