(include "#.scm")

(define bool #f)

(define z0  (list))
(define z1  (list 100))
(define z2  (list 100 101))
(define z3  (list 100 101 102))
(define z4  (list 100 101 102 103))
(define z5  (list 100 101 102 103 104))
(define z6  (list 100 101 102 103 104 105))
(define z7  (list 100 101 102 103 104 105 106))
(define z8  (list 100 101 102 103 104 105 106 107))
(define z9  (list 100 101 102 103 104 105 106 107 108))
(define z10 (list 100 101 102 103 104 105 106 107 108 109))

(check-tail-exn type-exception? (lambda () (ninth z0)))
(check-tail-exn type-exception? (lambda () (ninth z1)))
(check-tail-exn type-exception? (lambda () (ninth z2)))
(check-tail-exn type-exception? (lambda () (ninth z3)))
(check-tail-exn type-exception? (lambda () (ninth z4)))
(check-tail-exn type-exception? (lambda () (ninth z5)))
(check-tail-exn type-exception? (lambda () (ninth z6)))
(check-tail-exn type-exception? (lambda () (ninth z7)))
(check-tail-exn type-exception? (lambda () (ninth z8)))
(check-equal? (ninth z9) 108 )
(check-equal? (ninth z10) 108 )
(check-tail-exn type-exception? (lambda () (ninth bool)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (ninth)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (ninth z10 z10)))
