diff --git a/fare-matcher.asd b/fare-matcher.asd index 2f2c3fe0449dd7d870b2388a05f32bcbda9ffec6..fddaab4bfd243984858bd1337f594186e714c965 100644 --- a/fare-matcher.asd +++ b/fare-matcher.asd @@ -1,5 +1,7 @@ ;;; -*- 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))) diff --git a/test/fare-matcher-test.asd b/test/fare-matcher-test.asd index 592677a76f2c0bac8ea5e6224193dbb17a8b21a1..4e2e081d431454d20aedc1ba1ea7a54b436664b3 100644 --- a/test/fare-matcher-test.asd +++ b/test/fare-matcher-test.asd @@ -5,5 +5,4 @@ :depends-on (:fare-matcher :hu.dwim.stefil) :serial t :components ((:file "packages") - (:file "matcher") - (:file "quasiquote"))) + (:file "matcher"))) diff --git a/test/matcher.lisp b/test/matcher.lisp index 5367e61fcf52dfa1bc5a7c9d9497941c6806898b..7b4f469bda5422c59380fb84d443923b7d3734fa 100644 --- a/test/matcher.lisp +++ b/test/matcher.lisp @@ -1,3 +1,7 @@ #+xcvb (module (:depends-on ("packages"))) (in-package :fare-matcher-test) + +(defsuite* (fare-matcher-test + :in root-suite + :documentation "All fare-matcher tests")) diff --git a/test/packages.lisp b/test/packages.lisp index 18cdfc8881f43cd289399e462915a78424c10bb4..c83b01cf787b1a7c9b27853a5644a777a21700f0 100644 --- a/test/packages.lisp +++ b/test/packages.lisp @@ -1,6 +1,6 @@ #+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) diff --git a/test/quasiquote.lisp b/test/quasiquote.lisp deleted file mode 100644 index c7d84986e46e3f03838589aae0b9facd5156a16f..0000000000000000000000000000000000000000 --- a/test/quasiquote.lisp +++ /dev/null @@ -1,55 +0,0 @@ -#+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)" - (labels - ((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) - (progn - (princ " ") - (rprinc-list-contents x)) - (progn - (princ " . ") - (rprinc x)))))) - (cond - ((consp x) (rprinc-list x)) - (t (princ x))) - 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))))