mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-30 16:17:02 +01:00
gpgscm: Display location when assertions fail.
* tests/gpgscm/lib.scm (assert): Use location information if available. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
df00745d6e
commit
3949cbd112
@ -18,13 +18,16 @@
|
||||
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(macro (assert form)
|
||||
`(if (not ,(cadr form))
|
||||
(begin
|
||||
(display "Assertion failed: ")
|
||||
(write (quote ,(cadr form)))
|
||||
(newline)
|
||||
(exit 1))))
|
||||
(let ((tag (get-tag form)))
|
||||
`(if (not ,(cadr form))
|
||||
(throw ,(if (pair? tag)
|
||||
`(string-append ,(car tag) ":"
|
||||
,(number->string (+ 1 (cdr tag)))
|
||||
": Assertion failed: ")
|
||||
"Assertion failed: ")
|
||||
(quote ,(cadr form))))))
|
||||
(assert #t)
|
||||
(assert (not #f))
|
||||
|
||||
(define (filter pred lst)
|
||||
(cond ((null? lst) '())
|
||||
|
Loading…
x
Reference in New Issue
Block a user