Hello,
I can't seem to test a function I wrote in PLT Racket using the test-engine/racket-tests
package.
The code is listed below. It returns multiple values (not sure why they don't call them tuples).
(define (euclid-ext a b)
(cond
[(= b 0) (values a 1 0)]
[else (let-values ([(d x y) (euclid-ext b (modulo a b))])
(values d y (- x (* (quotient a b) y))))]
))
The problem is testing it using the following format. Here are a few that I have tried.
(check-expect (values (euclid-ext 99 78)) (values 3 -11 14))
(check-expect (euclid-ext 99 78) (values 3 -11 14))
(check-expect (list (euclid-ext 99 78)) (list 3 -11 14))
Right now, this produces the error context expected 1 value, received 3 values: 3 -11 14
. No matter how I try to work this (with lists, values, no values, etc) I cannot get this test case to evaluate successfully.