1 ;; TODO: Uncomment when either read-from-string supports all these parameters
2 ;; or when test macro supports error handling, whichever comes first
3 ;; (test (equal (read-from-string " 1 3 5" t nil :start 2) (values 3 5)))
5 (equal (multiple-value-list (read-from-string "(a b c)"))
8 (test (equal (symbol-name (read-from-string "cl:cond")) "COND"))
9 (test (equal (symbol-name (read-from-string "co|N|d")) "COND"))
10 (test (equal (symbol-name (read-from-string "abc\\def")) "ABCdEF"))
11 (test (equal (symbol-name (read-from-string "|.|")) "."))
12 (test (equal (read-from-string "(1 .25)") '(1 0.25)))
13 (test (equal (read-from-string ".25") 0.25))
14 (test (equal (read-from-string "(1 . 25)") '(1 . 25)))
16 (test (equal (read-from-string "(#1=99 2 3 #1#)") '(99 2 3 99)))
17 (let ((v (read-from-string "#(#1=99 2 3 #1#)")))
18 (test (and (eql (aref v 0) 99)
21 (eql (aref v 3) 99))))
23 (test (let ((x (read-from-string "#1=(42 . #1#)")))
24 (and (eql (nth 99 x) 42)
30 (test (let ((x (read-from-string "#1=#(1 #2=99 #1# #2#)")))
31 (and (eql (aref x 0) 1)
34 (eql (aref x 3) 99))))
36 (test (let ((x (read-from-string "#1=(1 2 #2=#(3 4 #1#) 5 #2#)")))
37 (and (eql (nth 0 x) 1)
39 (eql (aref (nth 2 x) 0) 3)
40 (eql (aref (nth 2 x) 1) 4)
41 (eq (aref (nth 2 x) 2) x)
43 (eq (nth 4 x) (nth 2 x)))))