add smoketests for FIND and REPLACE
[jscl.git] / tests / strings.lisp
1 (defvar *str* "hello world")
2 (defvar *str2* "h")
3
4 (test (stringp *str*))
5 (test (not (characterp *str*)))
6 (test (not (integerp *str*)))
7
8 (test (stringp *str2*))
9 (test (not (characterp *str2*)))
10 (test (not (integerp *str2*)))
11
12 (test (= (length "hello world") 11))
13 (test (arrayp "hello world"))
14
15 (test (string= "h" (string #\h)))
16 (test (string= "foo" "foo"))
17 (test (not (string= "Foo" "foo")))
18 (test (not (string= "foo" "foox")))
19
20 ;;; BUG: The compiler will macroexpand the forms below (char str N)
21 ;;; will expand to internal SBCL code instead of our (setf char). It
22 ;;; is because macrodefinitions during bootstrapping are not included
23 ;;; in the host's environment. It should, but we have to think how to
24 ;;; avoid conflicts (package renaming??)
25
26 ;; (let ((str "hello"))
27 ;;   (setf (char str 0) #\X)
28 ;;   (setf (char str 4) #\X)
29 ;;   (test (string= str "XellX")))