mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
test-suite: Add a nameless form of `pass-if-equal'.
* test-suite/test-suite/lib.scm (pass-if-equal): Add a nameless pattern. * test-suite/tests/arrays.test ("array->list"): Use `pass-if-equal'.
This commit is contained in:
parent
139ce19474
commit
80aeb9af0d
2 changed files with 8 additions and 6 deletions
|
@ -360,8 +360,10 @@
|
|||
(define-syntax pass-if-equal
|
||||
(syntax-rules ()
|
||||
"Succeed if and only if BODY's return value is equal? to EXPECTED."
|
||||
((_ expected body)
|
||||
(pass-if-equal 'body expected body))
|
||||
((_ name expected body ...)
|
||||
(run-test 'name #t
|
||||
(run-test name #t
|
||||
(lambda ()
|
||||
(let ((result (begin body ...)))
|
||||
(or (equal? expected result)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;;; unif.test --- tests guile's uniform arrays -*- scheme -*-
|
||||
;;;;
|
||||
;;;; Copyright 2004, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
;;;; Copyright 2004, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -211,10 +211,10 @@
|
|||
;;;
|
||||
|
||||
(with-test-prefix "array->list"
|
||||
(pass-if (equal? (array->list #s16(1 2 3)) '(1 2 3)))
|
||||
(pass-if (equal? (array->list #(1 2 3)) '(1 2 3)))
|
||||
(pass-if (equal? (array->list #2((1 2) (3 4) (5 6))) '((1 2) (3 4) (5 6))))
|
||||
(pass-if (equal? (array->list #()) '())))
|
||||
(pass-if-equal '(1 2 3) (array->list #s16(1 2 3)))
|
||||
(pass-if-equal '(1 2 3) (array->list #(1 2 3)))
|
||||
(pass-if-equal '((1 2) (3 4) (5 6)) (array->list #2((1 2) (3 4) (5 6))))
|
||||
(pass-if-equal '() (array->list #())))
|
||||
|
||||
|
||||
;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue