Commit 9e1306f1 authored by pfdietz's avatar pfdietz
Browse files

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"))
(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))
;;; 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>=))
\ No newline at end of file
;;; Specialized strings
(deftest search-string.19
(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)))
(deftest search-string.20
(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)))
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