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

Add tests for BufferedInput and fix couple of bugs #367

Closed
wants to merge 36 commits into from

Conversation

Mingun
Copy link
Collaborator

@Mingun Mingun commented Mar 8, 2022

This PR supersedes #357 because it refactors corresponding place.

This PR:

Number of commits a bit more that I could prefered in the PRs, but most of them are intended to show refactoring process in order to anybody could check that behavior is not changed -- I suppose it is obvious from the commits. Therefore, I recommend review PR by commit basis. Also, each commit in a fully buildable state except 9582fe5 which is fixed by the following commit and failed by design.

… case)

Bug was since merging 8d3cf19 (zero-copy parsing)
Lowercased `doctype` was introduced in 3c3a82c (html5 support)
…ion and fix part of #344

As a result the same optimization is applied for borrowed parsed in DOCTYPE
parsing as in non-borrowing one

This fixes the following tests (which is the reason of #344):
- reader::test::buffered::read_bang_element::comment::not_closed3
- reader::test::buffered::read_bang_element::comment::with_content
Because there is the only place where cycle can be interrupted
…g `assert_eq!`

This allow to see an actual comment content if test fail, but when comment was recognized
This required only as intermediate step to show, that nothing is changed in the logic

(Review this commit with whitespace ignored option)
(Review this commit with whitespace ignored option)
`State` from non-borrowed reader moved outside of function and renamed to
`ReadElementState`; code in borrowed reader adapted
@Mingun
Copy link
Collaborator Author

Mingun commented May 2, 2022

Merged in Mingun/fast-xml@9770634

@Mingun Mingun closed this May 2, 2022
@Mingun Mingun deleted the buffered-input-tests branch May 2, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant