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

Write a sourcepos test for each NodeValue variant #498

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SamWilsn
Copy link
Contributor

@SamWilsn SamWilsn commented Dec 4, 2024

Not sure if these are already covered elsewhere. I wrote one for my own knowledge, and kept going... A few are disabled because I believe the returned sourcepos are incorrect.

Apologies for stacking this on top of #497. Looking at just 38f2403 might be best.

@digitalmoksha
Copy link
Collaborator

Some of these are covered at the bottom of the specific test file, such as https://github.com/kivikakk/comrak/blob/main/src/tests/wikilinks.rs#L218-L276, though not everything is covered. So more coverage of this is super helpful.

Yeah, there is still more work to do on getting inline sourcepos working consistently.

@SamWilsn
Copy link
Contributor Author

SamWilsn commented Dec 6, 2024

How do you feel about the whole strum plus match approach to ensuring all variants are tested?

Comment on lines +398 to +409
List // end is 3:0
| Item // end is 3:0
| TaskItem // end is 4:0
| DescriptionItem // end is 4:0
| DescriptionTerm // end is 3:0
| DescriptionDetails // end is 4:0
| HtmlInline // end is 1:31 but should be 3:14
| LineBreak // start is 1:15 but should be 1:13
| Code // is 1:8-1:12 but should be 1:7-1:13
| ThematicBreak // end is 4:0
| Link // inconsistent between link types
| Math // is 3:2-3:6 but should be 3:1-3:7
Copy link
Contributor Author

@SamWilsn SamWilsn Dec 6, 2024

Choose a reason for hiding this comment

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

If y'all can confirm that all of these are bugs, I'll try my hand at fixing them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I think those are all incorrect sourcesos 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants