pyret-lang icon indicating copy to clipboard operation
pyret-lang copied to clipboard

matching text in `raises`

Open shriram opened this issue 5 years ago • 1 comments

Suppose I have the program:

type Integer = Number%(num-is-integer)

fun f(n :: Integer):
  n
end

I can write

check:
  f(0.5) raises "predicate"
  f(0.5) raises "num-is-integer"
end

but I can't match against the whole text:

  f(0.5) raises "predicate num-is-integer"

presumably because of the text formatting: image

Since we're matching against plain strings, should the text be stripped of formatting to enable such matches?

Curiously, the space lies in a DMZ, because both these fail:

  f(0.5) raises "predicate "
  f(0.5) raises " num-is-integer"

shriram avatar Sep 21 '20 12:09 shriram

It's worse than that, actually. I'm pretty sure raises matches against the to-string output of your error, which is the console text rendering, not the rich HTML rendering. I've been annoyed by this for a while, and haven't figured out a suitable repair... :-\

blerner avatar Sep 21 '20 12:09 blerner