aboutsummaryrefslogtreecommitdiff
path: root/src/data.lisp
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-05-05 08:29:23 -0300
committerSean Whitton <spwhitton@spwhitton.name>2022-05-05 12:26:10 -0700
commit4b0625d744e73e9e7ad3708320fba7fa2cab21ae (patch)
tree72be9aa75229617fe7693b71ba70edd63d3d503f /src/data.lisp
parent68cb80cfbcd7684cd2d2b8e5091d956aea71e9dd (diff)
downloadconsfigurator-4b0625d744e73e9e7ad3708320fba7fa2cab21ae.tar.gz
provide macro WITH-RESET-DATA-SOURCES
As the docstring hints, this will be used in the test suite. Signed-off-by: David Bremner <david@tethera.net>
Diffstat (limited to 'src/data.lisp')
-rw-r--r--src/data.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/data.lisp b/src/data.lisp
index 9a219c3..d5d9d4c 100644
--- a/src/data.lisp
+++ b/src/data.lisp
@@ -143,6 +143,15 @@ This function is typically called at the REPL."
*data-sources* nil
*data-source-registrations* nil))
+(defmacro with-reset-data-sources (&body body)
+ "Run BODY with initially empty data sources and string data.
+
+This macro is typically used for testing or debugging."
+ `(let ((*string-data* (make-hash-table))
+ *data-sources*
+ *data-source-registrations*)
+ ,@body))
+
(defun get-data-string (iden1 iden2)
"Return the content of an item of prerequisite data as a string.