Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Got rid of DEFLOOKUP-TABLE

  • Loading branch information...
commit 1c147ecf796d6ce9936d62a4e00d7905819bdeba 1 parent 4661efc
@adlai authored
Showing with 24 additions and 6 deletions.
  1. +13 −2 src/fixture.lisp
  2. +11 −4 src/test.lisp
View
15 src/fixture.lisp
@@ -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
15 src/test.lisp
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.