Test output for typed-lists [ok]

Testing time: 1s

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

Testing TYPED-LISTS-AND-SETS ...
----------------------------
(import cells immutable-lists)
... passed in (immutable-lists?)
(define nil (ilist-null))
... passed in (immutable-lists?)
(ilist? nil)
... passed in (immutable-lists?)
(ilist-null? nil)
... passed in (immutable-lists?)
(not (null? nil))
... passed in (immutable-lists?)
(define nls (ilist-cons 1 nil))
... passed in (immutable-lists?)
(ilist? nls)
... passed in (immutable-lists?)
nls
... passed in (immutable-lists?)
(define cl (cell 2))
... passed in (immutable-lists?)
(define nlst (ilist 0 1 cl 3 4))
... passed in (immutable-lists?)
(ilist? nlst)
... passed in (immutable-lists?)
(not (list? nlst))
... passed in (immutable-lists?)
nlst
... passed in (immutable-lists?)
(= (ilist-apply + 1 2 (ilist 3 4 5)) 15)
... passed in (immutable-lists?)
(ilist-equal? (ilist-repeat 5 0) (ilist 0 0 0 0 0))
... passed in (immutable-lists?)
(ilist-equal? (ilist-iterate 5 add1 0) (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-iterate-while (lambda (x) (< x 5)) add1 0)
  (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-iterate-until (lambda (x) (= x 5)) add1 0)
  (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-zip (ilist 1 2 3 4 5) (ilist 10 20 30))
  (ilist 1 10 2 20 3 30 4 5))
... passed in (immutable-lists?)
(receive
  (even odd)
  (ilist-unzip (ilist 0 1 2 3 4 5 6 7))
  (and (ilist-equal? even (ilist 0 2 4 6)) (ilist-equal? odd (ilist 1 3 5 7))))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-interpose 10 (ilist 1 2 3 4 5))
  (ilist 1 10 2 10 3 10 4 10 5))
... passed in (immutable-lists?)
(ilist-equal? (ilist-drop 3 nlst) (ilist 3 4))
... passed in (immutable-lists?)
(ilist-equal? (ilist-drop-while odd? (ilist 1 3 2 4 5)) (ilist 2 4 5))
... passed in (immutable-lists?)
(ilist-equal? (ilist-take-while odd? (ilist 1 3 2 4 5)) (ilist 1 3))
... passed in (immutable-lists?)
(receive
  (head tail)
  (ilist-split-with even? (ilist 1 3 2 4 5))
  (and (ilist-equal? head (ilist 1 3)) (ilist-equal? tail (ilist 2 4 5))))
... passed in (immutable-lists?)
(ilist-equal? (ilist-take 2 nlst) (ilist 0 1))
... passed in (immutable-lists?)
(define nrest (ilist-rest nlst))
... passed in (immutable-lists?)
nrest
... passed in (immutable-lists?)
(ilist? (ilist-null))
... passed in (immutable-lists?)
(ilist-null? (ilist-null))
... passed in (immutable-lists?)
(not (ilist-null? nls))
... passed in (immutable-lists?)
(not (ilist? '(1 2)))
... passed in (immutable-lists?)
(ilist-null? (ilist-rest nls))
... passed in (immutable-lists?)
(= (ilist-first nlst) 0)
... passed in (immutable-lists?)
(ilist? (ilist-reverse nlst))
... passed in (immutable-lists?)
(ilist-reverse nlst)
... passed in (immutable-lists?)
(equal? (ilist->list nlst) (list 0 1 cl 3 4))
... passed in (immutable-lists?)
(ilist-item 2 nlst)
evaluates to:
#<procedure (f_499 . rvar1423)>

((ilist-item 2 nlst))
evaluates to:
2

(xpr:val (ilist-item 2 nlst) ((ilist-item 2 nlst)))
... passed in (immutable-lists?)
(equal? (ilist-item 2 nlst) cl)
... passed in (immutable-lists?)
(cell-set! (ilist-item 2 nlst) 20)
... passed in (immutable-lists?)
(equal? (ilist-item 2 nlst) cl)
... passed in (immutable-lists?)
(= (cell-ref (ilist-item 2 nlst)) 20)
... passed in (immutable-lists?)
(= (ilist-length nlst) 5)
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-append (ilist 0 1 2 3) (ilist 4 5 6))
  (ilist 0 1 2 3 4 5 6))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-append
    (ilist 0)
    (ilist 1)
    (ilist 2)
    (ilist 3 4)
    (ilist 5 6 7)
    (ilist 8))
  (ilist 0 1 2 3 4 5 6 7 8))
... passed in (immutable-lists?)
(ilist-equal? (ilist-map add1 (ilist 0 1 2 3)) (ilist 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal? (ilist-map + (ilist 1 2 3) (ilist 10 20 30 40)) (ilist 11 22 33))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-mappend ilist (ilist 10 20 30) (ilist 1 2 3 4 5))
  (ilist 10 1 20 2 30 3))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-fold-right ilist-cons (ilist-null) (ilist 0 1 2 3 4))
  (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-fold-right ilist-cons (ilist 0 1 2) (ilist 3 4))
  (ilist 3 4 0 1 2))
... passed in (immutable-lists?)
(= (ilist-fold-right * 1 (ilist 1 2 3 4 5)) 120)
... passed in (immutable-lists?)
(= (ilist-fold-left * 1 (ilist 1 2 3 4 5)) 120)
... passed in (immutable-lists?)
(= (ilist-fold-left + 0 (ilist 1 2 3) (ilist 10 20 30)) 66)
... passed in (immutable-lists?)
(equal?
  (ilist-fold-left cons '(100) (ilist 1 2 3 4))
  '(((((100) . 1) . 2) . 3) . 4))
... passed in (immutable-lists?)
(equal?
  (call-with-values
    (lambda () (ilist-reverse (ilist 1 2 3) (ilist 10 20 30)))
    list)
  (list (ilist 3 2 1) (ilist 30 20 10)))
... passed in (immutable-lists?)
(ilist-equal? (ilist-remove 0 (ilist 1 0 2 0 3 0 4)) (ilist 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal?
  (ilist-merge < (ilist 2 4 5 7 8) (ilist 1 3 6 9 10))
  (ilist 1 2 3 4 5 6 7 8 9 10))
... passed in (immutable-lists?)
(not (condition-case (ilist-merge < (ilist-null) (ilist 1 3 2)) ((exn) #f)))
... passed in (immutable-lists?)
(ilist-equal? (ilist-merge-sort <= (ilist 2 0 1 4 3)) (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal? (ilist-insertion-sort < (ilist 2 0 1 4 3)) (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(not (ilist-sorted? <= (ilist 2 0 1 4 3)))
... passed in (immutable-lists?)
(ilist-sorted? <= (ilist 0 1 2 3 4))
... passed in (immutable-lists?)
(ilist-equal? (ilist-insert-sorted <= 2 (ilist 0 1 2 3 4)) (ilist 0 1 2 2 3 4))
... passed in (immutable-lists?)
(ilist-equal? (ilist-insert-sorted <= 5 (ilist 0 1 2 3 4)) (ilist 0 1 2 3 4 5))
... passed in (immutable-lists?)
(ilist-every? odd? (ilist 1 3 5))
... passed in (immutable-lists?)
(ilist-every? odd? (ilist))
... passed in (immutable-lists?)
(= (ilist-some odd? (ilist 2 3 5)) 3)
... passed in (immutable-lists?)
(not (ilist-some odd? (ilist 2 4 6)))
... passed in (immutable-lists?)
(ilist-not-every? odd? (ilist 1 2 3))
... passed in (immutable-lists?)
(ilist-not-any? odd? (ilist 2 4 6))
... passed in (immutable-lists?)
(ilist-in? (ilist 2 3) (ilist 1 2 3))
... passed in (immutable-lists?)
(not (ilist-in? (ilist 1 2 3) (ilist 2 3)))
... passed in (immutable-lists?)
(not (ilist-in? (ilist 1 2 3) (ilist 2 1 3)))
... passed in (immutable-lists?)
(ilist-in? (ilist) (ilist 2 3))
... passed in (immutable-lists?)
(import list-sets immutable-lists)
... passed in (sets?)
(set= (ilist->set (ilist 1 2 1 3 2 3)) (set 3 2 1))
... passed in (sets?)
(set? (set 1 2 3))
... passed in (sets?)
(set? (set 1 2 2 3))
... passed in (sets?)
(set= (set 2 1 3) (set 1 2 2 3))
... passed in (sets?)
(set-in? 2 (set 1 1 2 3))
... passed in (sets?)
(set<= (set 2 1 2) (set 4 1 2 3 4))
... passed in (sets?)
(set= (set-add 0 (set 1 2 3)) (set 0 1 2 3))
... passed in (sets?)
(set= (set-add 2 (set 1 2 3)) (set 1 2 3))
... passed in (sets?)
(= (set-cardinality (set 2 1 2 3 2)) 3)
... passed in (sets?)
(set= (set-remove 2 (set 2 1 2 3 2)) (set 1 3))
... passed in (sets?)
(set= (set 0 1 1 0 2 3 2) (set 2 3 0 1))
... passed in (sets?)
(set= (set-difference (set 0 2 1 3) (set 1 1)) (set 0 2 3))
... passed in (sets?)
(set= (set-union (set 1 2) (set 2 3) (set 3 4)) (set 1 2 3 4))
... passed in (sets?)
(set= (set-intersection (set 1 2 3 4) (set 2 3 5) (set 3 4)) (set 3))
... passed in (sets?)
(set= (set-filter odd? (set 2 1 3 3 1 1)) (set 3 1))
... passed in (sets?)
(module
  any
  (item? equ?)
  (import scheme)
  (define (item? x) #t)
  (define (equ? x y) (equal? x y)))
... passed in (any-lists?)
(module any-lists = (list-functor any))
... passed in (any-lists?)
(import (prefix any-lists any-) cells)
... passed in (any-lists?)
(define als (any-ilist-repeat 3 (cell #f)))
... passed in (any-lists?)
(any-ilist? als)
... passed in (any-lists?)
(not (list? als))
... passed in (any-lists?)
(= (any-ilist-length als) 3)
... passed in (any-lists?)
(equal? (any-ilist->list (any-ilist-map cell-ref als)) (make-list 3))
... passed in (any-lists?)
(define cl (cell 3))
... passed in (any-lists?)
(define alst (any-ilist (lambda (x) #f) 'a "x" cl #\z))
... passed in (any-lists?)
(procedure? (any-ilist-first alst))
... passed in (any-lists?)
(any-ilist-equal? (any-ilist-memp cell? alst) (any-ilist cl #\z))
... passed in (any-lists?)
(any-ilist-equal?
  (any-ilist-member #\z alst)
  (any-ilist-cons #\z (any-ilist-null)))
... passed in (any-lists?)
(module
  strings
  (equ? item?)
  (import scheme)
  (define equ? string=?)
  (define item? string?))
... passed in (string-lists?)
(module string-lists = (list-functor strings))
... passed in (string-lists?)
(import (prefix string-lists str-))
... passed in (string-lists?)
(str-ilist-equal?
  (str-ilist-append (str-ilist "a" "b") (str-ilist "c"))
  (str-ilist "a" "b" "c"))
... passed in (string-lists?)
(module
  symbols
  (equ? item?)
  (import scheme)
  (define equ? eq?)
  (define item? symbol?))
... passed in (symbol-lists?)
(module symbol-lists = (list-functor symbols))
... passed in (symbol-lists?)
(import (prefix symbol-lists sym-))
... passed in (symbol-lists?)
(sym-ilist-equal?
  (sym-ilist-append (sym-ilist 'a 'b) (sym-ilist 'c))
  (sym-ilist 'a 'b 'c))
... passed in (symbol-lists?)
(equal? (sym-ilist-bind (x y z) (sym-ilist 'a 'b 'c) (list x y z)) '(a b c))
... passed in (symbol-lists?)
(sym-ilist-equal?
  (sym-ilist-bind (x . y) (sym-ilist 'a 'b 'c) y)
  (sym-ilist 'b 'c))
... passed in (symbol-lists?)
(sym-ilist-bind (x . y) (sym-ilist 'a 'b) (list x y))
evaluates to:
(a [b])

(xpr:val (sym-ilist-bind (x . y) (sym-ilist 'a 'b) (list x y)))
... passed in (symbol-lists?)
(sym-ilist-null? (sym-ilist-bind x (sym-ilist-null) x))
... passed in (symbol-lists?)
(sym-ilist-bind () (sym-ilist-null) #t)
... passed in (symbol-lists?)
(module
  lists
  (equ? item?)
  (import scheme (only data-structures list-of?) (only chicken condition-case))
  (define equ? equal?)
  (define item? (list-of? symbol?)))
... passed in (list-lists?)
(module list-lists = (list-functor lists))
... passed in (list-lists?)
(import (prefix list-lists lst-))
... passed in (list-lists?)
(not (condition-case (lst-ilist-cons '(1) (lst-ilist-null)) ((exn) #f)))
... passed in (list-lists?)
(lst-ilist-equal?
  (lst-ilist-append (lst-ilist '(a) '(b)) (lst-ilist '(c)))
  (lst-ilist '(a) '(b) '(c)))
... passed in (list-lists?)
(module
  pairs
  (item? equ?)
  (import scheme)
  (define (item? x) (and (pair? x) (number? (car x)) (string? (cdr x))))
  (define equ? equal?))
... passed in (pair-lists?)
(module pair-lists = (list-functor pairs))
... passed in (pair-lists?)
(import (prefix pair-lists nsp-))
... passed in (pair-lists?)
(define nspl (nsp-ilist (cons 1 "one") (cons 2 "two") (cons 3 "three")))
... passed in (pair-lists?)
(equal? (nsp-ilist-assoc 2 nspl) '(2 . "two"))
... passed in (pair-lists?)
(not (nsp-ilist-assp zero? nspl))
... passed in (pair-lists?)
(module
  nums
  (item? equ?)
  (import scheme)
  (define item? number?)
  (define equ? =))
... passed in (num-sets?)
(module num-lists = (list-functor nums))
... passed in (num-sets?)
(module num-sets = (set-functor nums num-lists))
... passed in (num-sets?)
(import (prefix num-lists num-) (prefix num-sets num-))
... passed in (num-sets?)
(num-set= (num-ilist->set (num-ilist 1 2 1 3 2 3)) (num-set 3 2 1))
... passed in (num-sets?)
(num-set? (num-set 1 2 3))
... passed in (num-sets?)
(num-set? (num-set 1 2 2 3))
... passed in (num-sets?)
(num-set= (num-set 2 1 3) (num-set 1 2 2 3))
... passed in (num-sets?)
(num-set-in? 2 (num-set 1 1 2 3))
... passed in (num-sets?)
(num-set<= (num-set 2 1 2) (num-set 4 1 2 3 4))
... passed in (num-sets?)
(num-set= (num-set-add 0 (num-set 1 2 3)) (num-set 0 1 2 3))
... passed in (num-sets?)
(num-set= (num-set-add 2 (num-set 1 2 3)) (num-set 1 2 3))
... passed in (num-sets?)
(= (num-set-cardinality (num-set 2 1 2 3 2)) 3)
... passed in (num-sets?)
(num-set= (num-set-remove 2 (num-set 2 1 2 3 2)) (num-set 1 3))
... passed in (num-sets?)
(num-set= (num-set 0 1 1 0 2 3 2) (num-set 2 3 0 1))
... passed in (num-sets?)
(num-set= (num-set-difference (num-set 0 2 1 3) (num-set 1 1)) (num-set 0 2 3))
... passed in (num-sets?)
(num-set=
  (num-set-union (num-set 1 2) (num-set 2 3) (num-set 3 4))
  (num-set 1 2 3 4))
... passed in (num-sets?)
(num-set=
  (num-set-intersection (num-set 1 2 3 4) (num-set 2 3 5) (num-set 3 4))
  (num-set 3))
... passed in (num-sets?)
(num-set= (num-set-filter odd? (num-set 2 1 3 3 1 1)) (num-set 3 1))
... passed in (num-sets?)

Results of TYPED-LISTS-AND-SETS
----------------------------
All tests passed