93 |
(read-from-string (concatenate 'string (list c #\Z c))) |
(read-from-string (concatenate 'string (list c #\Z c))) |
94 |
(error (c) c)) |
(error (c) c)) |
95 |
(handler-case |
(handler-case |
96 |
(read-from-string (concatenate 'string (list c #\Z #\|))) |
(read-from-string (concatenate 'string (list c #\z #\|))) |
97 |
(error (c) c)) |
(error (c) c)) |
98 |
(handler-case |
(handler-case |
99 |
(read-from-string (concatenate 'string (list #\| #\Z c))) |
(read-from-string (concatenate 'string (list #\| #\Z c))) |
100 |
(error (c) c))))) |
(error (c) c))))) |
101 |
(unless (or (eql c #\Z) (equal results '(t |Z| |Z| |Z|))) |
(unless (or (eql c #\Z) (eql c #\z) (equal results '(t |Z| |z| |Z|))) |
102 |
(list c results)))))) |
(list c results)))))) |
103 |
nil) |
nil) |
104 |
|
|
|
|
|
|
|
|
105 |
|
(deftest set-syntax-from-char.semicolon |
106 |
|
(loop for c across +standard-chars+ |
107 |
|
nconc |
108 |
|
(with-standard-io-syntax |
109 |
|
(let ((*readtable* (copy-readtable nil)) |
110 |
|
(*package* (find-package "CL-TEST")) |
111 |
|
(expected (if (eql c #\0) '1 '0)) |
112 |
|
(c2 (if (eql c #\0) #\1 #\0))) |
113 |
|
(let ((results |
114 |
|
(list |
115 |
|
(set-syntax-from-char c #\;) |
116 |
|
(handler-case |
117 |
|
(read-from-string (concatenate 'string (list c2 c #\2))) |
118 |
|
(error (c) c)) |
119 |
|
(handler-case |
120 |
|
(read-from-string (concatenate 'string (list c2 c #\2 #\Newline #\3))) |
121 |
|
(error (c) c)) |
122 |
|
(handler-case |
123 |
|
(read-from-string (concatenate 'string (list c #\2 #\Newline c2))) |
124 |
|
(error (c) c))))) |
125 |
|
(unless (equal results (list t expected expected expected)) |
126 |
|
(list c results)))))) |
127 |
|
nil) |
128 |
|
|