(module check-info-test mzscheme
(require "test.ss"
"check-info.ss")
(provide check-info-tests)
(define check-info-tests
(test-suite "All check-info tests"
(test-case
"with-check-info stores value in lexical order"
(let ((stack (with-check-info
(('1 1)
('2 2)
('3 3))
(check-stack))))
(for-each (lambda (actual expected)
(check-eq? (check-info-name actual)
expected))
stack
(list '1 '2 '3))))
(test-case
"Nested uses of with-check-info store values in lexical order"
(let ((stack (with-check-info
(('1 1)
('2 2)
('3 3))
(with-check-info
(('4 4)
('5 5)
('6 6))
(check-stack)))))
(for-each (lambda (actual expected)
(check-eq? (check-info-name actual)
expected))
stack
(list '1 '2 '3 '4 '5 '6))))
(test-case
"check-actual? and check-expected? work"
(check-true (check-actual? (make-check-actual 1)))
(check-true (check-expected? (make-check-expected 1)))
(check-false (check-expected? (make-check-actual 1)))
(check-false (check-expected? (make-check-actual 1))))
(test-case
"make-check-actual and make-check-expected store param"
(check-equal? (check-info-value (make-check-actual 1)) 1)
(check-equal? (check-info-value (make-check-expected 2)) 2))
))
)