Commit fcbb7d6f authored by Michał Herda's avatar Michał Herda 🤔
Browse files

Fix READTABLE-CASE.CASE tests

This fixes the symbol-interning issues that might have occured when `READ-FROM-STRING`
was internally called in the wrong package.

This also fixes the fact that the test names had no home package.
parent ed4a6bd6
...@@ -58,18 +58,19 @@ ...@@ -58,18 +58,19 @@
;; readtable-case reading ;; readtable-case reading
(symbol-macrolet ((lookup-table (symbol-macrolet ((lookup-table
'(:SYMBOL ("zebra" "Zebra" "ZEBRA" "zebr\\a" "zebr\\A" "ZEBR\\a" "ZEBR\\A" "Zebr\\a" "Zebr\\A") '(:SYMBOL ("zebra" "Zebra" "ZEBRA" "zebr\\a" "zebr\\A" "ZEBR\\a" "ZEBR\\A" "Zebr\\a" "Zebr\\A")
:UPCASE (|ZEBRA| |ZEBRA| |ZEBRA| |ZEBRa| |ZEBRA| |ZEBRa| |ZEBRA| |ZEBRa| |ZEBRA|) :UPCASE ("ZEBRA" "ZEBRA" "ZEBRA" "ZEBRa" "ZEBRA" "ZEBRa" "ZEBRA" "ZEBRa" "ZEBRA")
:DOWNCASE (|zebra| |zebra| |zebra| |zebra| |zebrA| |zebra| |zebrA| |zebra| |zebrA|) :DOWNCASE ("zebra" "zebra" "zebra" "zebra" "zebrA" "zebra" "zebrA" "zebra" "zebrA")
:PRESERVE (|zebra| |Zebra| |ZEBRA| |zebra| |zebrA| |ZEBRa| |ZEBRA| |Zebra| |ZebrA|) :PRESERVE ("zebra" "Zebra" "ZEBRA" "zebra" "zebrA" "ZEBRa" "ZEBRA" "Zebra" "ZebrA")
:INVERT (|ZEBRA| |Zebra| |zebra| |ZEBRa| |ZEBRA| |zebra| |zebrA| |Zebra| |ZebrA|)))) :INVERT ("ZEBRA" "Zebra" "zebra" "ZEBRa" "ZEBRA" "zebra" "zebrA" "Zebra" "ZebrA"))))
(macrolet (macrolet
((def-readtable-case-test (reader-case) ((def-readtable-case-test (reader-case)
`(deftest ,(make-symbol (concatenate 'string "READTABLE-CASE.CASE-" `(deftest ,(intern (concatenate 'string "READTABLE-CASE.CASE-"
(symbol-name reader-case))) (symbol-name reader-case))
(find-package :cl-test))
(let ((*readtable* (copy-readtable))) (let ((*readtable* (copy-readtable)))
(setf (readtable-case *readtable*) ,reader-case) (setf (readtable-case *readtable*) ,reader-case)
(mapcar #'(lambda (x) (mapcar #'(lambda (x)
(read-from-string x)) (symbol-name (read-from-string x)))
',(getf lookup-table :symbol))) ',(getf lookup-table :symbol)))
,(getf lookup-table reader-case)))) ,(getf lookup-table reader-case))))
(def-readtable-case-test :upcase) (def-readtable-case-test :upcase)
......
Supports Markdown
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