Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stepper breaks test-engine contract #214

Closed
mikesperber opened this issue Dec 25, 2023 · 3 comments
Closed

Stepper breaks test-engine contract #214

mikesperber opened this issue Dec 25, 2023 · 3 comments
Assignees
Labels
stepper test engine topics related to the test engine

Comments

@mikesperber
Copy link
Member

mikesperber commented Dec 25, 2023

Run this in the stepper with the current head of racket/htdp:

#lang htdp/bsl
(check-expect 1 1)

You get

add-test!: expects a boolean, given (cons #true '())
  in: the range of
      the 1st argument of
      (-> (-> boolean?) any)
  contract from: 
      <pkgs>/htdp-lib/test-engine/test-engine.rkt
  blaming: <pkgs>/htdp-lib/test-engine/syntax.rkt
   (assuming the contract is correct)
  at: <pkgs>/htdp-lib/test-engine/test-engine.rkt:18:11

(This also shows up in the stepper tests.)

So somehow the return value from the check-expect test (which is supposed to be just plain #true) gets wrapped in a one-element list. I banged by head against this for a while, but am getting nowhere, unfortunately.

This is not a new problem - it's just popped up again as the contract for add-test! was tightened.

@shhyou shhyou added stepper test engine topics related to the test engine labels Dec 25, 2023
@rfindler
Copy link
Member

I think that this line looks suspicious. Probably the (#%plain-app values results) should really be (#%plain-app apply values results).

When I make that change it seems to solve the original issue. @jbclements does that seem like the right fix to you?

@jbclements
Copy link
Contributor

jbclements commented Dec 31, 2023 via email

@mikesperber
Copy link
Member Author

@jbclements In the past, nothing used the return value of the tests, so that's why it was OK to ignore, and also why there was this lame any in the relevant contract. (I should really have reported this back then when I noticed it first but was too unsure of how things are supposed to work with the stepper - sorry!) This just changed, so the contract was tightened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stepper test engine topics related to the test engine
Projects
None yet
Development

No branches or pull requests

4 participants