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

Turn stupicat tests into proper Rust tests #13

Open
badboy opened this issue May 13, 2020 · 4 comments
Open

Turn stupicat tests into proper Rust tests #13

badboy opened this issue May 13, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@badboy
Copy link
Contributor

badboy commented May 13, 2020

What do you think about turning the tests that are currently done using the stupicat example into proper Rust tests?

We can have a tests/roundtrip.rs or similar that consumes the fixtures, runs against the API and checks the output.
That way a simple cargo test really runs all the required tests.

@Byron Byron added the help wanted Extra attention is needed label May 13, 2020
@Byron
Copy link
Owner

Byron commented May 13, 2020

I like the proposition! The reason for doing it that way was my convenience only, but doing it that way might not be the most maintainable thing to do for the project.

A benefit of doing it that way was the visual diffing, and I wonder if 'insta' could be useful here for snapshot testing.

If there is no visual way of testing, this might be a good opportunity to split up the big input file into smaller chunks to make clearer what is important there.

@badboy
Copy link
Contributor Author

badboy commented May 13, 2020

Maybe with things like pretty-assertions or directly using a diff crate.
I play around and see what works with not too much overhead.

@felipesere
Copy link

👋 I'd be keen to add some insta tests.
I'm looking to use pulldown-cmark and pulldown-cmark-to-cmark for a side project so this would be a useful contribution 💜

@Byron
Copy link
Owner

Byron commented Nov 29, 2021

By all means, please give it a shot. I wonder what the strategy would be. Is it pulling parts of the stupicat example out into insta so that the individual diffs are more maintainable?

Note that by now, we also are running the entire common mark spec without about 2/3 succeeding. All tests are generated, and maybe insta even has a place there to make the individual tests more easily viewable.

In any case, I'd prefer it if these insta tests aren't overlapping with what's there, ideally with bolstering the spec based tests while reducing stupicat ones if they aren't adding anything over the spec tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants