Skip to content

Conversation

@sabiwara
Copy link
Contributor

Close #14210

Screenshot 2025-01-28 at 8 44 16

raise ArgumentError, message: "Unexpected:\n#{inspect(arg)}"
end
end
|> ExUnit.BeamHelpers.write_beam()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test when the error message itself has "..." at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 468bfbc.
I'm not sure it's too useful since technically if we allow for anything then there's little reason for ... not to pass, but it doesn't cost much to have it so I'm fine either way.

Comment on lines 607 to 608
case String.replace_suffix(expected, "...", "") do
^expected -> false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be an expensive check to verify if the string has ... or not. My suggestion is to use String.ends_with? and then binary_slice.

Co-authored-by: José Valim <[email protected]>
@sabiwara sabiwara merged commit 4087560 into elixir-lang:main Jan 28, 2025
8 of 9 checks passed
@sabiwara sabiwara deleted the doctest-ellipsis branch January 28, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

doctest cannot match on exceptions with blank lines in them

2 participants