Test output for srfi-42 [fail]

Testing time: 16s

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

(let ((x 0)) (do-ec (set! x (+ x 1))) x)
  => 1 ; correct

(let ((x 0)) (do-ec (:range i 10) (set! x (+ x 1))) x)
  => 10 ; correct

(let ((x 0)) (do-ec (:range n 10) (:range k n) (set! x (+ x 1))) x)
  => 45 ; correct

(list-ec 1)
  => (1) ; correct

(list-ec (:range i 4) i)
  => (0 1 2 3) ; correct

(list-ec (:range n 3) (:range k (+ n 1)) (list n k))
  => ((0 0) (1 0) (1 1) (2 0) (2 1) (2 2)) ; correct

(list-ec (:range n 5) (if (even? n)) (:range k (+ n 1)) (list n k))
  => ((0 0) (2 0) (2 1) (2 2) (4 0) (4 1) (4 2) (4 3) (4 4)) ; correct

(list-ec (:range n 5) (not (even? n)) (:range k (+ n 1)) (list n k))
  => ((1 0) (1 1) (3 0) (3 1) (3 2) (3 3)) ; correct

(list-ec (:range n 5) (and (even? n) (> n 2)) (:range k (+ n 1)) (list n k))
  => ((4 0) (4 1) (4 2) (4 3) (4 4)) ; correct

(list-ec (:range n 5) (or (even? n) (> n 3)) (:range k (+ n 1)) (list n k))
  => ((0 0) (2 0) (2 1) (2 2) (4 0) (4 1) (4 2) (4 3) (4 4)) ; correct

(let ((x 0)) (list-ec (:range n 10) (begin (set! x (+ x 1))) n) x)
  => 10 ; correct

(list-ec (nested (:range n 3) (:range k n)) k)
  => (0 0 1) ; correct

(append-ec (quote (a b)))
  => (a b) ; correct

(append-ec (:range i 0) (quote (a b)))
  => () ; correct

(append-ec (:range i 1) (quote (a b)))
  => (a b) ; correct

(append-ec (:range i 2) (quote (a b)))
  => (a b a b) ; correct

(string-ec #\a)
  => "a" ; correct

(string-ec (:range i 0) #\a)
  => "" ; correct

(string-ec (:range i 1) #\a)
  => "a" ; correct

(string-ec (:range i 2) #\a)
  => "aa" ; correct

(string-append-ec "ab")
  => "ab" ; correct

(string-append-ec (:range i 0) "ab")
  => "" ; correct

(string-append-ec (:range i 1) "ab")
  => "ab" ; correct

(string-append-ec (:range i 2) "ab")
  => "abab" ; correct

(vector-ec 1)
  => #(1) ; correct

(vector-ec (:range i 0) i)
  => #() ; correct

(vector-ec (:range i 1) i)
  => #(0) ; correct

(vector-ec (:range i 2) i)
  => #(0 1) ; correct

(vector-of-length-ec 1 1)
  => #(1) ; correct

(vector-of-length-ec 0 (:range i 0) i)
  => #() ; correct

(vector-of-length-ec 1 (:range i 1) i)
  => #(0) ; correct

(vector-of-length-ec 2 (:range i 2) i)
  => #(0 1) ; correct

(sum-ec 1)
  => 1 ; correct

(sum-ec (:range i 0) i)
  => 0 ; correct

(sum-ec (:range i 1) i)
  => 0 ; correct

(sum-ec (:range i 2) i)
  => 1 ; correct

(sum-ec (:range i 3) i)
  => 3 ; correct

(product-ec 1)
  => 1 ; correct

(product-ec (:range i 1 0) i)
  => 1 ; correct

(product-ec (:range i 1 1) i)
  => 1 ; correct

(product-ec (:range i 1 2) i)
  => 1 ; correct

(product-ec (:range i 1 3) i)
  => 2 ; correct

(product-ec (:range i 1 4) i)
  => 6 ; correct

(min-ec 1)
  => 1 ; correct

(min-ec (:range i 1) i)
  => 0 ; correct

(min-ec (:range i 2) i)
  => 0 ; correct

(max-ec 1)
  => 1 ; correct

(max-ec (:range i 1) i)
  => 0 ; correct

(max-ec (:range i 2) i)
  => 1 ; correct

(first-ec #f 1)
  => 1 ; correct

(first-ec #f (:range i 0) i)
  => #f ; correct

(first-ec #f (:range i 1) i)
  => 0 ; correct

(first-ec #f (:range i 2) i)
  => 0 ; correct

(let ((last-i -1)) (first-ec #f (:range i 10) (begin (set! last-i i)) i) last-i)
  => 0 ; correct

(last-ec #f 1)
  => 1 ; correct

(last-ec #f (:range i 0) i)
  => #f ; correct

(last-ec #f (:range i 1) i)
  => 0 ; correct

(last-ec #f (:range i 2) i)
  => 1 ; correct

(any?-ec #f)
  => #f ; correct

(any?-ec #t)
  => #t ; correct

(any?-ec (:range i 2 2) (even? i))
  => #f ; correct

(any?-ec (:range i 2 3) (even? i))
  => #t ; correct

(every?-ec #f)
  => #f ; correct

(every?-ec #t)
  => #t ; correct

(every?-ec (:range i 2 2) (even? i))
  => #t ; correct

(every?-ec (:range i 2 3) (even? i))
  => #t ; correct

(every?-ec (:range i 2 4) (even? i))
  => #f ; correct

(let ((sum-sqr (lambda (x result) (+ result (* x x))))) (fold-ec 0 (:range i 10) i sum-sqr))
  => 285 ; correct

(let ((minus-1 (lambda (x) (- x 1))) (sum-sqr (lambda (x result) (+ result (* x x))))) (fold3-ec (error "wrong") (:range i 10) i minus-1 sum-sqr))
  => 284 ; correct

(fold3-ec (quote infinity) (:range i 0) i min min)
  => infinity ; correct

(list-ec (:list x (quote ())) x)
  => () ; correct

(list-ec (:list x (quote (1))) x)
  => (1) ; correct

(list-ec (:list x (quote (1 2 3))) x)
  => (1 2 3) ; correct

(list-ec (:list x (quote (1)) (quote (2))) x)
  => (1 2) ; correct

(list-ec (:list x (quote (1)) (quote (2)) (quote (3))) x)
  => (1 2 3) ; correct

(list-ec (:string c "") c)
  => () ; correct

(list-ec (:string c "1") c)
  => (#\1) ; correct

(list-ec (:string c "123") c)
  => (#\1 #\2 #\3) ; correct

(list-ec (:string c "1" "2") c)
  => (#\1 #\2) ; correct

(list-ec (:string c "1" "2" "3") c)
  => (#\1 #\2 #\3) ; correct

(list-ec (:vector x (vector)) x)
  => () ; correct

(list-ec (:vector x (vector 1)) x)
  => (1) ; correct

(list-ec (:vector x (vector 1 2 3)) x)
  => (1 2 3) ; correct

(list-ec (:vector x (vector 1) (vector 2)) x)
  => (1 2) ; correct

(list-ec (:vector x (vector 1) (vector 2) (vector 3)) x)
  => (1 2 3) ; correct

(list-ec (:range x -2) x)
  => () ; correct

(list-ec (:range x -1) x)
  => () ; correct

(list-ec (:range x 0) x)
  => () ; correct

(list-ec (:range x 1) x)
  => (0) ; correct

(list-ec (:range x 2) x)
  => (0 1) ; correct

(list-ec (:range x 0 3) x)
  => (0 1 2) ; correct

(list-ec (:range x 1 3) x)
  => (1 2) ; correct

(list-ec (:range x -2 -1) x)
  => (-2) ; correct

(list-ec (:range x -2 -2) x)
  => () ; correct

(list-ec (:range x 1 5 2) x)
  => (1 3) ; correct

(list-ec (:range x 1 6 2) x)
  => (1 3 5) ; correct

(list-ec (:range x 5 1 -2) x)
  => (5 3) ; correct

(list-ec (:range x 6 1 -2) x)
  => (6 4 2) ; correct

(list-ec (:real-range x 0.0 3.0) x)
  => (0.0 1.0 2.0) ; correct

(list-ec (:real-range x 0 3.0) x)
  => (0.0 1.0 2.0) ; correct

(list-ec (:real-range x 0 3 1.0) x)
  => (0.0 1.0 2.0) ; correct

(string-ec (:char-range c #\a #\z) c)
  => "abcdefghijklmnopqrstuvwxyz" ; correct

(begin (let ((f (my-open-output-file "tmp1"))) (do-ec (:range n 10) (begin (write n f) (newline f))) (close-output-port f)) (my-call-with-input-file "tmp1" (lambda (port) (list-ec (:port x port read) x))))
  => (0 1 2 3 4 5 6 7 8 9) ; correct

(begin (let ((f (my-open-output-file "tmp1"))) (do-ec (:range n 10) (begin (write n f) (newline f))) (close-output-port f)) (my-call-with-input-file "tmp1" (lambda (port) (list-ec (:port x port) x))))
  => (0 1 2 3 4 5 6 7 8 9) ; correct

(list-ec (:do ((i 0)) (< i 4) ((+ i 1))) i)
  => (0 1 2 3) ; correct

(list-ec (:do (let ((x (quote x)))) ((i 0)) (< i 4) (let ((j (- 10 i)))) #t ((+ i 1))) j)
  => (10 9 8 7) ; correct

(list-ec (:let x 1) x)
  => (1) ; correct

(list-ec (:let x 1) (:let y (+ x 1)) y)
  => (2) ; correct

(list-ec (:let x 1) (:let x (+ x 1)) x)
  => (2) ; correct

(list-ec (:parallel (:range i 1 10) (:list x (quote (a b c)))) (list i x))
  => ((1 a) (2 b) (3 c)) ; correct

(list-ec (:while (:range i 1 10) (< i 5)) i)
  => (1 2 3 4) ; correct

(list-ec (:until (:range i 1 10) (>= i 5)) i)
  => (1 2 3 4 5) ; correct

(list-ec (:while (:list i (quote (1 2 3 4 5 6 7 8 9))) (< i 5)) i)
  => (1 2 3 4) ; correct

(list-ec (:until (:list i (quote (1 2 3 4 5 6 7 8 9))) (>= i 5)) i)
  => (1 2 3 4 5) ; correct

(list-ec (:while (:vector x (index i) (quote #(1 2 3 4 5))) (< x 10)) x)
  => (1 2 3 4 5) ; correct

(list-ec (:while (:parallel (:range i 1 10) (:list j (quote (1 2 3 4 5 6 7 8 9)))) (< i 5)) (list i j))
  => ((1 1) (2 2) (3 3) (4 4)) ; correct

(list-ec (:until (:parallel (:range i 1 10) (:list j (quote (1 2 3 4 5 6 7 8 9)))) (>= i 5)) (list i j))
  => ((1 1) (2 2) (3 3) (4 4) (5 5)) ; correct

(let ((n 0)) (do-ec (:while (:range i 1 10) (begin (set! n (+ n 1)) (< i 5))) (if #f #f)) n)
  => 5 ; correct

(let ((n 0)) (do-ec (:until (:range i 1 10) (begin (set! n (+ n 1)) (>= i 5))) (if #f #f)) n)
  => 5 ; correct

(let ((n 0)) (do-ec (:while (:parallel (:range i 1 10) (:do () (begin (set! n (+ n 1)) #t) ())) (< i 5)) (if #f #f)) n)
  => 5 ; correct

(let ((n 0)) (do-ec (:until (:parallel (:range i 1 10) (:do () (begin (set! n (+ n 1)) #t) ())) (>= i 5)) (if #f #f)) n)
  => 5 ; correct

(list-ec (: c (quote (a b))) c)
  => (a b) ; correct

(list-ec (: c (quote (a b)) (quote (c d))) c)
  => (a b c d) ; correct

(list
Error: unbound variable: fx>

	Call history:

	<syntax>	  (|+11580| j 1)
	<syntax>	  (##core#undefined)
	<syntax>	  (##core#undefined)
	<syntax>	  (##core#let () loop11593)
	<syntax>	  (##core#begin loop11593)
	<syntax>	  (##core#undefined)
	<syntax>	  (quote11547 ())
	<syntax>	  (##core#quote ())
	<eval>	  (newline11532)
	<eval>	  (write11533 (quote11534 (list-ec (:range i (index j) 0 -3 -1) (list i j))))
	<eval>	  (newline11532)
	<eval>	  (reverse!11545 (fold-ec11546 (quote11547 ()) (:range i (index j) 0 -3 -1) (list i j) cons11548))
	<eval>	  (not11572 (fixnum?11573 b11570))
	<eval>	  (fixnum?11573 b11570)
	<eval>	  ((##core#letrec* ((loop11593 (##core#loop-lambda (i j) (ec-simplify11592 (if11594 (and11587 (fx>1157...
	<eval>	  (fx>11575 i b11570)	<--
-ec (: c "ab") c)
  => (#\a #\b) ; correct

(list-ec (: c "ab" "cd") c)
  => (#\a #\b #\c #\d) ; correct

(list-ec (: c (vector (quote a) (quote b))) c)
  => (a b) ; correct

(list-ec (: c (vector (quote a) (quote b)) (vector (quote c))) c)
  => (a b c) ; correct

(list-ec (: i 0) i)
  => () ; correct

(list-ec (: i 1) i)
  => (0) ; correct

(list-ec (: i 10) i)
  => (0 1 2 3 4 5 6 7 8 9) ; correct

(list-ec (: i 1 2) i)
  => (1) ; correct

(list-ec (: i 1 2 3) i)
  => (1) ; correct

(list-ec (: i 1 9 3) i)
  => (1 4 7) ; correct

(list-ec (: i 0.0 1.0 0.2) i)
  => (0.0 0.2 0.4 0.6 0.8) ; correct

(list-ec (: c #\a #\c) c)
  => (#\a #\b #\c) ; correct

(begin (let ((f (my-open-output-file "tmp1"))) (do-ec (:range n 10) (begin (write n f) (newline f))) (close-output-port f)) (my-call-with-input-file "tmp1" (lambda (port) (list-ec (: x port read) x))))
  => (0 1 2 3 4 5 6 7 8 9) ; correct

(begin (let ((f (my-open-output-file "tmp1"))) (do-ec (:range n 10) (begin (write n f) (newline f))) (close-output-port f)) (my-call-with-input-file "tmp1" (lambda (port) (list-ec (: x port) x))))
  => (0 1 2 3 4 5 6 7 8 9) ; correct

(list-ec (:list c (index i) (quote (a b))) (list c i))
  => ((a 0) (b 1)) ; correct

(list-ec (:string c (index i) "a") (list c i))
  => ((#\a 0)) ; correct

(list-ec (:vector c (index i) (vector (quote a))) (list c i))
  => ((a 0)) ; correct

(list-ec (:range i (index j) 0 -3 -1) (list i j))