Back Edit Delete

The purpose of area is to produce the area of a square whose side length is n. The function is (define (area n) (* n n)), but a test says (check-expect (area 3) 3) and fails. What should you change, and why?

Short answer

Accepted answer

Change the expected value in the test from 3 to 9: (check-expect (area 3) 9). The function correctly follows the purpose; the test expectation is wrong.