From 68cb80cfbcd7684cd2d2b8e5091d956aea71e9dd Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 5 May 2022 08:29:22 -0300 Subject: 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 --- src/package.lisp | 1 + src/util.lisp | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src') 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=)) -- cgit v1.2.3