Test output for generics [ok]

Testing time: 1s

'/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/bin/csi' -script run.scm < /dev/null 2>&1

Testing GENERICS ...
----------------------------
(equal?
  (receive (rhead tail) (rsplit-with odd? '(1 3 5 2 4 6)) (list rhead tail))
  '(() (1 3 5 2 4 6)))
... passed in (Generic-helpers)
(equal?
  (receive (rhead tail) (rsplit-with even? '(1 3 5 2 4 6)) (list rhead tail))
  '((5 3 1) (2 4 6)))
... passed in (Generic-helpers)
(equal?
  (receive (rhead tail) (rsplit-at 3 '(0 1 2 3 4 5 6)) (list rhead tail))
  '((2 1 0) (3 4 5 6)))
... passed in (Generic-helpers)
(equal? (reverse* '(10 20 30) '(1 2 3 4 5)) '(30 20 10 1 2 3 4 5))
... passed in (Generic-helpers)
(equal? (reverse* '(10 20 30) '(1 2 3 4 5) list) '(30 (20 (10 (1 2 3 4 5)))))
... passed in (Generic-helpers)
(equal? (reverse* '(10 20 30) '0 list) '(30 (20 (10 . 0))))
... passed in (Generic-helpers)
(equal? (reverse* '(10 20 30) '(0 . 1) list) '(30 (20 (10 (0 . 1)))))
... passed in (Generic-helpers)
(equal?
  (reverse* '(10 20 30) '((0 . 1) (0 . 2)) list)
  '(30 (20 (10 (0 . 1) (0 . 2)))))
... passed in (Generic-helpers)
(equal? (map* add1 '(0 (1 (2 . 3)))) '(1 (2 (3 . 4))))
... passed in (Generic-helpers)
(equal? (map* add1 '(0 (1 (2) 3) 4)) '(1 (2 (3) 4) 5))
... passed in (Generic-helpers)
(equal? (map* add1 '(0 1 2)) '(1 2 3))
... passed in (Generic-helpers)
(= (map* add1 0) 1)
... passed in (Generic-helpers)
(= ((repeat 3 add1) 0) 3)
... passed in (Generic-helpers)
(equal? ((repeat 2 cdr) '(0 1 2 3)) '(2 3))
... passed in (Generic-helpers)
(equal?
  (substring
    (symbol->string
      (proc-name (named-lambda (! n) (if (zero? n) 1 (* n (! (- n 1)))))))
    0
    1)
  "!")
... passed in (Generic-helpers)
(equal?
  (map (named-lambda (! n) (if (zero? n) 1 (* n (! (- n 1))))) '(1 2 3 4 5))
  '(1 2 6 24 120))
... passed in (Generic-helpers)
(eq? (proc-name number?) 'scheme#number?)
... passed in (Generic-helpers)
(eq? (proc-name +) 'C_plus)
... passed in (Generic-helpers)
(selector? fixnum??)
... passed in (Selectors)
(equal? (selector-parents fixnum??) `(,integer?? ,number?? ,any??))
... passed in (Selectors)
(eq? (index??) any??)
... passed in (Selectors)
(method-tree-item? item)
... passed in (Trees)
(equal? item `(,number?? unquote +))
... passed in (Trees)
(method-tree? (list item))
... passed in (Trees)
(fx= (method-tree-depth (list item)) 1)
... passed in (Trees)
(set! item (method-tree-item string-append string?? string??))
... passed in (Trees)
(method-tree-item? item)
... passed in (Trees)
(equal? item `(,string?? (,string?? unquote string-append)))
... passed in (Trees)
(method-tree? (list item))
... passed in (Trees)
(fx= (method-tree-depth (list item)) 2)
... passed in (Trees)
(equal? (cadr item) `(,string?? unquote string-append))
... passed in (Trees)
(eq? (cdadr item) string-append)
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item string-append string?? string??)))
... passed in (Trees)
(set! tree (method-tree-insert tree (method-tree-item + number?? number??)))
... passed in (Trees)
(method-tree? tree)
... passed in (Trees)
(fx= (method-tree-depth tree) 2)
... passed in (Trees)
(equal?
  (method-tree-show tree)
  '((generics#list?? (generics#list?? . scheme#append))
    (generics#string?? (generics#string?? . scheme#string-append))
    (generics#number?? (generics#number?? . C_plus))))
... passed in (Trees)
(eq? (method-tree-dispatch tree '() '()) append)
... passed in (Trees)
(eq? (method-tree-dispatch tree #t #t) #f)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0) +)
... passed in (Trees)
(eq? (method-tree-dispatch tree "" "") string-append)
... passed in (Trees)
(eq? (method-tree-dispatch tree '() 0) #f)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 '()) #f)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 "") #f)
... passed in (Trees)
(set! tree (list (method-tree-item fx+ fixnum?? fixnum??)))
... passed in (Trees)
(set! tree (method-tree-insert tree (method-tree-item fn+ fixnum?? number??)))
... passed in (Trees)
(set! tree (method-tree-insert tree (method-tree-item nf+ number?? fixnum??)))
... passed in (Trees)
(set! tree (method-tree-insert tree (method-tree-item nn+ number?? number??)))
... passed in (Trees)
(method-tree? tree)
... passed in (Trees)
(fx= (method-tree-depth tree) 2)
... passed in (Trees)
(equal?
  (method-tree-show tree)
  '((generics#fixnum??
      (generics#fixnum?? . chicken.fixnum#fx+)
      (generics#number?? . fn+))
    (generics#number?? (generics#fixnum?? . nf+) (generics#number?? . nn+))))
... passed in (Trees)
(eq? (method-tree-dispatch tree 0.0 0.0) nn+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0.0) fn+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0.0 0) nf+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0) fx+)
... passed in (Trees)
(not (method-tree-dispatch tree #f 0))
... passed in (Trees)
(not (method-tree-dispatch tree 0 #f))
... passed in (Trees)
(not (method-tree-dispatch tree #f #f))
... passed in (Trees)
(set! tree (list (method-tree-item nnn+ number?? number?? number??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item fff+ fixnum?? fixnum?? fixnum??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item ffn+ fixnum?? fixnum?? number??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item fnf+ fixnum?? number?? fixnum??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item fnn+ fixnum?? number?? number??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item nff+ number?? fixnum?? fixnum??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item nfn+ number?? fixnum?? number??)))
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item nnf+ number?? number?? fixnum??)))
... passed in (Trees)
(method-tree? tree)
... passed in (Trees)
(fx= (method-tree-depth tree) 3)
... passed in (Trees)
(equal? tree otree)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0 0) fff+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0.0 0 0) nff+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0 0.0) ffn+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0.0 0.0) fnn+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0 0.0 0) fnf+)
... passed in (Trees)
(eq? (method-tree-dispatch tree 0.0 0.0 0.0) nnn+)
... passed in (Trees)
(set! tree
  (method-tree-insert tree (method-tree-item + number?? number?? number??)))
... passed in (Trees)
(eq? (method-tree-dispatch tree 0.0 0.0 0.0) +)
... passed in (Trees)
(not (method-tree-dispatch tree 0 0 #f))
... passed in (Trees)
(not (method-tree-dispatch tree 0 #f #f))
... passed in (Trees)
(not (method-tree-dispatch tree #f 0 0))
... passed in (Trees)
(not (method-tree-dispatch tree 0.0 0.0 #f))
... passed in (Trees)
(not (method-tree-dispatch tree 0.0 0 #f))
... passed in (Trees)
(not (method-tree-dispatch tree 0.0 #f 0.0))
... passed in (Trees)
(define-method (Add (x fixnum??) (y fixnum??)) (fx+ x y))
... passed in (Generics)
(generic? Add)
... passed in (Generics)
(not (generic-variadic? Add))
... passed in (Generics)
(fx= (generic-arity Add) 2)
... passed in (Generics)
(= (Add 1 2.0) 3.0)
... passed in (Generics)
(fx= (Add 1 2) 3)
... passed in (Generics)
(not (condition-case (Add 1) ((exn) #f)))
... passed in (Generics)
(not (condition-case (Add 1 #f) ((exn) #f)))
... passed in (Generics)
(= (At 2 seq) 2)
... passed in (Generics)
(equal? (Drop 2 seq) '(2 3 4))
... passed in (Generics)
(equal? (Take 2 seq) '(0 1))
... passed in (Generics)
(generic? At)
... passed in (Generics)
(not (generic-variadic? At))
... passed in (Generics)
(= (generic-arity At) 2)
... passed in (Generics)
(define-method (At (k index??) (seq vector??)) (vector-ref seq k))
... passed in (Generics)
(define-method (Drop (k index??) (seq vector??)) (subvector seq k))
... passed in (Generics)
(define-method (Take (k index??) (seq vector??)) (subvector seq 0 k))
... passed in (Generics)
(define-method (At (k index??) (seq string??)) (string-ref seq k))
... passed in (Generics)
(define-method (Drop (k index??) (seq string??)) (substring seq k))
... passed in (Generics)
(define-method (Take (k index??) (seq string??)) (substring seq 0 k))
... passed in (Generics)
(not (generic-variadic? At))
... passed in (Generics)
(fx= (generic-arity Take) 2)
... passed in (Generics)
(string=? (Drop 2 "abcde") "cde")
... passed in (Generics)
(fx= (At 2 seq) 2)
... passed in (Generics)
(equal? (Take 2 #(0 1 2 3 4)) #(0 1))
... passed in (Generics)
(define-method (Add* xs list??) (apply append xs))
... passed in (Generics)
(fx= (Add* 1 2 3) 6)
... passed in (Generics)
(equal? (Add* '(1) '(2) '(3)) '(1 2 3))
... passed in (Generics)
(define-method (Add* xs string??) (apply string-append xs))
... passed in (Generics)
(string=? (Add* "1" "2" "3") "123")
... passed in (Generics)
(not (condition-case (Add* 1 #f 3) ((exn) #f)))
... passed in (Generics)
(generic? Add*)
... passed in (Generics)
(generic-variadic? Add*)
... passed in (Generics)
(fx= (generic-arity Add*) 1)
... passed in (Generics)

Results of GENERICS
----------------------------
All tests passed