aboutsummaryrefslogtreecommitdiff
path: root/src/util.lisp
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-05-05 08:29:22 -0300
committerSean Whitton <spwhitton@spwhitton.name>2022-05-05 12:26:10 -0700
commit68cb80cfbcd7684cd2d2b8e5091d956aea71e9dd (patch)
tree4763e94359d78ccc1bec23e5e9aaa2045c3c0030 /src/util.lisp
parent8cfab42bc3a063f48a3934326818f1c5f2ca9721 (diff)
downloadconsfigurator-68cb80cfbcd7684cd2d2b8e5091d956aea71e9dd.tar.gz
run tests with temporary gpg home
The big picture change here is the introduction of a custom test runner which allows setting up and tearing down various data sources (or other resources) for the test suite. In order to parse the output of gpg, provide a new exported function CONSFIGURATOR:STRIP-PREFIX. Signed-off-by: David Bremner <david@tethera.net>
Diffstat (limited to 'src/util.lisp')
-rw-r--r--src/util.lisp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.lisp b/src/util.lisp
index d123e8c..e20b113 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -72,6 +72,11 @@
(defun unwords (words)
(format nil "~{~A~^ ~}" words))
+(defun strip-prefix (prefix string)
+ "If STRING is prefixed by PREFIX, return the rest of STRING,
+otherwise return NIL."
+ (nth-value 1 (starts-with-subseq prefix string :return-suffix t)))
+
(defun memstr= (string list)
(member string list :test #'string=))