Removed some unnecessary code that ignored an anaphor in define-ps-special-form ...
[clinton/parenscript.git] / t / ref2test.lisp
index f49677b..7c761a8 100644 (file)
@@ -1,23 +1,24 @@
-(in-package :js-test)
+(in-package :ps-test)
 ;;Generates automatic tests from the reference
 
+(defparameter +this-dir+ (asdf:component-pathname (asdf:find-component (asdf:find-system :parenscript.test) "t")))
 (defparameter +reference-file+ (merge-pathnames
-                                (make-pathname :directory '(:relative :back "docs"))
-                                (make-pathname :name "reference"
-                                               :type "lisp"
-                                               :defaults *load-truename*)))
-
+                                (make-pathname :directory '(:relative :back "docs")
+                                               :name "reference"
+                                               :type "lisp")
+                                +this-dir+))
 
 (defparameter +generate-file+ (make-pathname :name "reference-tests"
                                               :type "lisp"
-                                              :defaults *load-truename*))
+                                              :defaults +this-dir+))
 
-(defparameter +head+ "(in-package :js-test)
+(defparameter +head+ "(in-package :ps-test)
 ;; Tests of everything in the reference.
 ;; File is generated automatically from the text in reference.lisp by
 ;; the function make-reference-tests-dot-lisp in ref2test.lisp
 ;; so do not edit this file.
-(def-suite ref-tests)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (def-suite ref-tests))
 (in-suite ref-tests)~%~%") ; a double-quote for emacs: "
 
 (defun make-reference-tests-dot-lisp()
                                      :test #'char=)))
            (strip-indentation (str indentation)
              (if indentation
-                 (js::string-join (mapcar #'(lambda (str)
+                 (parenscript::string-join (mapcar #'(lambda (str)
                                           (if (> (length str) indentation)
                                               (subseq str indentation)
                                               str))
-                                      (js::string-split str (list #\Newline)))
+                                      (parenscript::string-split str (list #\Newline)))
                               (string #\Newline))
                  str))
 
@@ -67,8 +68,8 @@
                  ((search "=>" (subseq built (+ 1 sep-pos)))
                   (format t "Error , two separators found~%"))
                  ((and (string= heading "regular-expression-literals")
-                       (= 2 heading-count)) ;requires cl-interpol reader
-                  (format t "Skipping regex-test two~&"))
+                       (= 3 heading-count)) ;requires cl-interpol reader
+                  (format t "Skipping regex-test with cl-interpol&"))
                  ((and lisp-part javascript-part)
                   (format out-stream "(test-ps-js ~a-~a~%  ~a~%  \"~a\")~%~%"
                           heading heading-count
                          built (concatenate 'string built
                                             (when (not (empty-p built))
                                               (list #\Newline))
-                                            line))))))
-        (format out-stream "~%(run-tests)~%")))))
+                                            line))))))))))
+
+(make-reference-tests-dot-lisp)
\ No newline at end of file