Permalink
Browse files

Got rid of DEFLOOKUP-TABLE

  • Loading branch information...
adlai committed Sep 1, 2009
1 parent 4661efc commit 1c147ecf796d6ce9936d62a4e00d7905819bdeba
Showing with 24 additions and 6 deletions.
  1. +13 −2 src/fixture.lisp
  2. +11 −4 src/test.lisp
View
@@ -2,8 +2,19 @@
(in-package :Eos)
-(deflookup-table fixture
- :documentation "Lookup table mapping fixture names to fixture objects.")
+(defvar *fixture* (build-hash-table '(:test eql) nil)
+ "Table mapping fixture names to fixture objects.")
+
+(defun get-fixture (key &optional default)
+ (gethash key *fixture* default))
+
+(defun (setf get-fixture) (value key)
+ (when (gethash key *fixture*)
+ (warn "Redefining fixture ~a" key))
+ (setf (gethash key *fixture*) value))
+
+(defun rem-fixture (key)
+ (remhash key *fixture*))
(defmacro def-fixture (name args &body body)
"Defines a fixture named NAME. A fixture is very much like a
View
@@ -2,10 +2,17 @@
(in-package :Eos)
-(deflookup-table test
- :at-redefinition nil
- :documentation "Lookup table mapping test (and test suite)
- names to objects.")
+(defvar *test* (build-hash-table '(:test eql) nil)
+ "Table containing all test and test suite objects.")
+
+(defun get-test (key &optional default)
+ (gethash key *test* default))
+
+(defun (setf get-test) (value key)
+ (setf (gethash key *test*) value))
+
+(defun rem-test (key)
+ (remhash key *test*))
(defun test-names ()
(loop for test being the hash-keys of *test* collect test))

0 comments on commit 1c147ec

Please sign in to comment.