racket / htdp

Other
91 stars 70 forks source link

Runtime error causes tests above to run twice and tests below to run never #203

Closed ccshan closed 1 year ago

ccshan commented 1 year ago

In the Beginning Student Language, running a program such as

(check-expect 1 1)
(check-expect 2 2)
(+ "hello" "world")
(check-expect 3 3)
(check-expect 4 4)
(check-expect 5 5)

produces the result

Both tests passed!+: expects a number, given "hello"
Both tests passed!

Similarly if (+ "hello" "world") is replaced by (cond [false "hello"])

This is confusing because

mfelleisen commented 1 year ago
  1. Use #lang htdp/bsl instead of the menu-based teaching languages. -- In that setting I can't reproduce the bug.

    • Using #lang comes with other advantages.
  2. This bug seems to be new, but I don't have time today to check it out. @mikesperber ?

mikesperber commented 1 year ago

@ccshan As you'll notice, there's still no newline before the error message. It is surprisingly difficult to put one there without introducing spurious, conspicuous newlines in regular output. Can you live with that? (As @mfelleisen notes, the #lang versions don't have this problem.)

ccshan commented 1 year ago

I can live with that.