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

check-expect snip output unfriendly #673

Open
jasonhemann opened this issue Jun 24, 2024 · 10 comments
Open

check-expect snip output unfriendly #673

jasonhemann opened this issue Jun 24, 2024 · 10 comments

Comments

@jasonhemann
Copy link

The following error-scenario seems unnecessarily unfriendly, and I'm wondering if something nicer is possible.

A student might write the following test program:

#lang htdp/bsl
(require 2htdp/image)
(check-expect (circle 10 'outline 'black) 'o)

This test will fail. The student receives an error message containing a snip that contains the expected value. Our student then---mistakenly, accidentally, or what have you---then picks up the whole snip and drops that in as a replacement expect value.

Now that student sees the even more confusing:

Actual value . differs from (instantiate (class ...) ...), the expected value.

This seems especially injurious because it shows up when a student is already grappling with code that isn't behaving the way he expects. I for one do not know how to explain this behavior in a way that makes good sense to a BSL student. Is something nicer is possible?

I do not know if this properly belongs here, or in the htdp repo, or elsewhere.

@rfindler
Copy link
Member

I'm not sure what's the best fix for this either, but one possibility might be an error saying that the box around the image snip is not a legal program in BSL. If that sounds right, then I think that that'd be a change in the bsl repo somewhere.

@mfelleisen
Copy link
Contributor

mfelleisen commented Jun 25, 2024 via email

@sorawee
Copy link
Contributor

sorawee commented Jun 25, 2024

Why would a student copy-and-paste the square when he expects to see a black circle?

Perhaps the student might not know that it is possible to copy only just the circle, and thought that the frame is just for decoration. I could see myself easily make this mistake.

@mfelleisen
Copy link
Contributor

mfelleisen commented Jun 25, 2024 via email

@rfindler
Copy link
Member

FWIW, I agree with Sorawee that what Jason describes is a totally reasonable (although wrong) thing to do and it would be good if something better happened in response to it. That said, I don't get what Matthias is trying to say with the if expression.

@jasonhemann
Copy link
Author

I don't quite understand the suggested fix yet either.

@sorawee
Copy link
Contributor

sorawee commented Jun 30, 2024

My guess is that Matthias was suggesting a workaround to make the framing snip comparable as an image?

@mfelleisen
Copy link
Contributor

That's exactly what my if expression was supposed to suggest. [[ Sorry I was on the road for the week. ]]

@shhyou
Copy link
Collaborator

shhyou commented Jul 3, 2024

If I got it right, it looks like the framed thingy is an editor% snip here.
https://github.com/racket/htdp/blob/8037f1cc620ed91fe68362ce5ad3d887269eb725/htdp-lib/test-engine/markup-gui.rkt#L145-L152
Is it possible for the copy behavior of the snip be changed to copying its content instead? (Or perhaps changing the pasting behavior. IIRC some snips do this.)

@rfindler
Copy link
Member

rfindler commented Jul 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants