mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 14:30:34 +02:00
* tests/r4rs.test (SECTION 3 4): Each element of type-matrix
corresponds to an example object, not a predicate. Aubrey probably never noticed this because SCM doesn't check the lengths of the arguments to for-each and map...
This commit is contained in:
parent
1b0549522b
commit
efd59562ee
1 changed files with 15 additions and 14 deletions
|
@ -110,23 +110,24 @@
|
|||
(list boolean? char? null? number? pair? procedure? string? symbol? vector?))
|
||||
(define type-examples
|
||||
(list
|
||||
#t #f #\a '() 9739 '(test) record-error "test" "" 'test '#() '#(a b c) ))
|
||||
(define i 1)
|
||||
#t #f #\a '() 9739 '(test) (lambda () #f) car "test" "" 'test
|
||||
'#() '#(a b c)))
|
||||
(define type-matrix
|
||||
(map (lambda (x)
|
||||
(let ((t (map (lambda (f) (f x)) disjoint-type-functions)))
|
||||
t))
|
||||
(let ((t (map (lambda (f) (f x)) disjoint-type-functions)))
|
||||
t))
|
||||
type-examples))
|
||||
(for-each (lambda (predicate row)
|
||||
(let ((count (apply + (map (lambda (elt) (if elt 1 0))
|
||||
row))))
|
||||
(pass-if (call-with-output-string
|
||||
(lambda (port)
|
||||
(display "predicate is disjoint: " port)
|
||||
(display predicate port)))
|
||||
(= count 1))))
|
||||
disjoint-type-functions
|
||||
type-matrix)
|
||||
(for-each (lambda (object row)
|
||||
(let ((count (apply + (map (lambda (elt) (if elt 1 0))
|
||||
row))))
|
||||
(pass-if (call-with-output-string
|
||||
(lambda (port)
|
||||
(display "object recognized by only one predicate: "
|
||||
port)
|
||||
(display object port)))
|
||||
(= count 1))))
|
||||
type-examples
|
||||
type-matrix)
|
||||
|
||||
(SECTION 4 1 2)
|
||||
(test '(quote a) 'quote (quote 'a))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue