mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-24 16:43:28 +02: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/>.
|
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(macro (assert form)
|
(macro (assert form)
|
||||||
`(if (not ,(cadr form))
|
(let ((tag (get-tag form)))
|
||||||
(begin
|
`(if (not ,(cadr form))
|
||||||
(display "Assertion failed: ")
|
(throw ,(if (pair? tag)
|
||||||
(write (quote ,(cadr form)))
|
`(string-append ,(car tag) ":"
|
||||||
(newline)
|
,(number->string (+ 1 (cdr tag)))
|
||||||
(exit 1))))
|
": Assertion failed: ")
|
||||||
|
"Assertion failed: ")
|
||||||
|
(quote ,(cadr form))))))
|
||||||
(assert #t)
|
(assert #t)
|
||||||
|
(assert (not #f))
|
||||||
|
|
||||||
(define (filter pred lst)
|
(define (filter pred lst)
|
||||||
(cond ((null? lst) '())
|
(cond ((null? lst) '())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user