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

[WIP] Add diff to doctest #7585

Merged
merged 1 commit into from Apr 23, 2018

Conversation

Projects
None yet
2 participants
@wasnotrice
Contributor

wasnotrice commented Apr 23, 2018

This adds diff output to doctests, as discussed on elixir-core.

I haven't figured out a good way to add more tests for these changes. I have tested the changes manually, and they produce good output on complex data structures like Maps. Output is diffed just like normal in ExUnit tests. Are the existing (updated) tests sufficient, do you think?

I thought of adding a test to lib/ex_unit/examples/difference.exs, which exercises highlighting, but since doctests require creating a BEAM file, I wasn't sure this was the best approach. The current file is simple and understandable, and I didn't want to lose that quality.

I also thought to add a case to the doctests suite, but this would only test that left and right values are included, and the other tests already do that. I don't think we can test the actual highlighting here.

Thoughts?

Add diff to doctest
Pass both left and right values into `test_case_content`, so that failures get
diff highlighting

@josevalim josevalim merged commit 2f5c147 into elixir-lang:master Apr 23, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@josevalim

This comment has been minimized.

Member

josevalim commented Apr 23, 2018

❤️ 💚 💙 💛 💜

@wasnotrice wasnotrice deleted the wasnotrice:add-diff-to-doctest branch Apr 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment