(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 () (second z0)))
(check-tail-exn type-exception? (lambda () (second z1)))
(check-equal? (second z2) 101 )
(check-equal? (second z3) 101 )
(check-equal? (second z4) 101 )
(check-equal? (second z5) 101 )
(check-equal? (second z6) 101 )
(check-equal? (second z7) 101 )
(check-equal? (second z8) 101 )
(check-equal? (second z9) 101 )
(check-equal? (second z10) 101 )
(check-tail-exn type-exception? (lambda () (second bool)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (second)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (second z10 z10)))
