Commit 526131a1 by Francois-Rene Rideau

Remove fare-quasiquote from tests.

parent 71cf1921
;;; -*- Lisp -*-
(in-package :asdf)
(defsystem :fare-matcher
:description "Lisp2-style Erlang/ML-like Extensible Pattern-Matcher for CL"
:long-description "fare-matcher allows you to do pattern matching as in ML,
......@@ -12,3 +14,8 @@ and to define your own extensions."
;;#-gcl ; 2.7.0-64.1 cannot defgeneric in a eval-now
(:file "clos-match")
(:file "mrd-extensions")))
(defmethod perform ((op test-op) (sys (eql (find-system :fare-matcher))))
(format t "~&Testing fare-matcher")
(load-system :fare-matcher-test)
(funcall (find-symbol* :fare-matcher-test :fare-matcher-test)))
......@@ -5,5 +5,4 @@
:depends-on (:fare-matcher :hu.dwim.stefil)
:serial t
:components ((:file "packages")
(:file "matcher")
(:file "quasiquote")))
(:file "matcher")))
#+xcvb (module (:depends-on ("packages")))
(in-package :fare-matcher-test)
(defsuite* (fare-matcher-test
:in root-suite
:documentation "All fare-matcher tests"))
#+xcvb (module ())
(in-package #:cl-user)
(in-package #:cl)
(defpackage #:fare-matcher-test
(:use #:fare-matcher #:fare-quasiquote #:fare-utils #:common-lisp #:hu.dwim.stefil)
#+xcvb (module (:depends-on ("packages")))
(in-package :fare-matcher-test)
;; This version of princ allows one to see
;; inside of your implementation's version of quasiquoted expressions...
(defun rprinc (x)
"hand-made princ that allows to see inside quasiquotes
(results are implementation-dependent)"
((rprinc-list (x)
(princ "(")
(rprinc-list-contents x)
(princ ")"))
(rprinc-list-contents (x)
(rprinc (car x))
(rprinc-cdr (cdr x)))
(rprinc-cdr (x)
(if x (if (consp x)
(princ " ")
(rprinc-list-contents x))
(princ " . ")
(rprinc x))))))
((consp x) (rprinc-list x))
(t (princ x)))
;; You can test the quasiquote implementation like this:
(defvar *saved-readtable* *readtable*)
(defparameter *fq-readtable* (copy-readtable *saved-readtable*))
(enable-quasiquote :readtable *fq-readtable*)
(defun fq (s)
(let ((*readtable* *fq-readtable*))
(read-from-string s)))
(defparameter b 11)
(deftest test-quasiquote ()
(macrolet ((q (x y)
`(is (equal (fq ,x) ',y))))
(q "``a" (quote (quote a)))
(q "`(a ,b)" (list (quote a) b))
(q "``(a ,b)" (quote (list (quote a) b)))
(q "`(a ,b)" (list (quote a) b))
(q "`(a ,x ,@y)" (list* (quote a) x y))
;;(is (equal (ifmatch `(a ,x ,@y) '(a b c d) (list x y)) '(b (c d))))
(q "`(1 2 3)" (quote (1 2 3)))
(q "`(a ,b ,@c .,d)" (list* (quote a) b (append c d)))
(q "`(,@c .,d)" (append c d))))
Markdown is supported
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