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 (test (equal (read-from-string "#(#1=99 2 3 #1#)") '#(99 2 3 99)))
19 (test (let ((x (read-from-string "#1=(42 . #1#)")))
20 (and (eql (nth 99 x) 42)
26 (test (let ((x (read-from-string "#1=#(1 #2=99 #1# #2#)")))
27 (and (eql (aref x 0) 1)
30 (eql (aref x 3) 99))))
32 (test (let ((x (read-from-string "#1=(1 2 #2=#(3 4 #1#) 5 #2#)")))
33 (and (eql (nth 0 x) 1)
35 (eql (aref (nth 2 x) 0) 3)
36 (eql (aref (nth 2 x) 1) 4)
37 (eq (aref (nth 2 x) 2) x)
39 (eq (nth 4 x) (nth 2 x)))))