diff options
author | David Bremner <david@tethera.net> | 2022-05-05 08:29:22 -0300 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-05-05 12:26:10 -0700 |
commit | 68cb80cfbcd7684cd2d2b8e5091d956aea71e9dd (patch) | |
tree | 4763e94359d78ccc1bec23e5e9aaa2045c3c0030 /src | |
parent | 8cfab42bc3a063f48a3934326818f1c5f2ca9721 (diff) | |
download | consfigurator-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')
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/util.lisp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/package.lisp b/src/package.lisp index 0ea8241..3819017 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -105,6 +105,7 @@ #:unlines #:words #:unwords + #:strip-prefix #:memstr= #:define-simple-error #:plist-to-long-options 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=)) |