mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
gpgscm: Guard use of tagged expressions.
* tests/gpgscm/init.scm (vm-history-print): Check that the tag added to expressions when parsing source files matches the expected format. * tests/gpgscm/lib.scm (assert): Likewise. -- This makes the error handling more robust. We saw the assumption about the format of the tags being violated on one build system, and it obscured the view on the underlying problem. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
99d4dfe836
commit
aab6ba0bb6
@ -547,11 +547,11 @@
|
||||
(display n)
|
||||
(display ": ")
|
||||
(let ((tag (get-tag f)))
|
||||
(unless (null? tag)
|
||||
(display (basename (car tag)))
|
||||
(display ":")
|
||||
(display (+ 1 (cdr tag)))
|
||||
(display ": ")))
|
||||
(when (and (pair? tag) (string? (car tag)) (number? (cdr tag)))
|
||||
(display (basename (car tag)))
|
||||
(display ":")
|
||||
(display (+ 1 (cdr tag)))
|
||||
(display ": ")))
|
||||
(write f))
|
||||
(newline)
|
||||
(loop (+ n 1) skip (cdr frames))))))
|
||||
|
@ -20,7 +20,7 @@
|
||||
(macro (assert form)
|
||||
(let ((tag (get-tag form)))
|
||||
`(if (not ,(cadr form))
|
||||
(throw ,(if (pair? tag)
|
||||
(throw ,(if (and (pair? tag) (string? (car tag)) (number? (cdr tag)))
|
||||
`(string-append ,(car tag) ":"
|
||||
,(number->string (+ 1 (cdr tag)))
|
||||
": Assertion failed: ")
|
||||
|
Loading…
x
Reference in New Issue
Block a user