; CS 111 - Week 6 Labs - 11:00 lab - 2016-09-30 ;======== ; check-range expects an expression to test, ; the lower-bound of a desired range (inclusive), ; and the upper-bound of a desired range (inclusive), ; and test passes if the value of the expression ; to test is within that range ; [lower-bound, upper-bound] ; (for example, this can be nice for testing if a function ; involving random returns a value within expected ; bounds!) (check-range (+ 1 3) 4 8) (check-range (random 3) 0 2) ;======== ; check-member-of expects an expression to test, ; and expressions that might be the value of that ; expression, and passes if the value of the expression ; to test is one of those other expressions ; (for example, this can be useful if a function ; returns a random enumeration value) (check-member-of (string-append "a" "") "a" "b" "c" "d" "e") (check-member-of (+ 1 (random 4)) 1 2 3 4)