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

Rev yaml-test-suite submodule and fix Unix build #631

Closed
wants to merge 1 commit into from

Conversation

am11
Copy link
Contributor

@am11 am11 commented Aug 16, 2021

  • Update yaml-test-suite submodule to latest release
    • Some new parser tests came to light which need addressing. I will follow up on this
    • Emitter cases are continuing to pile up, I just added new ones to the list
  • Fix failing tests on Unix due to platform differences
  • Add .gitattributes to avoid checking in code with CRLF ending (which leaves the repo with inconsistent line-endings)

@am11 am11 force-pushed the feature/rev-spec-suite-submodule branch from 6e51317 to 78a876c Compare August 16, 2021 18:31
@am11 am11 force-pushed the feature/rev-spec-suite-submodule branch from 78a876c to d8ea651 Compare August 17, 2021 21:30
@@ -39,71 +39,71 @@ private sealed class ParserSpecTestsData : SpecTestsData

private static readonly List<string> ignoredSuites = new List<string>
{
// no spec test is ignored as of https://github.com/yaml/yaml-test-suite/releases/tag/data-2020-02-11
"5T43", "JR7V", "NKF9", "CFD4", "U99R"
Copy link
Contributor Author

@am11 am11 Aug 18, 2021

Choose a reason for hiding this comment

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

@aaubry, I have started working on fixing these new cases; got the first one fixed here am11@5943247.


Plain style scanning

From parsing architecture perspective, one significant issue is that we have FetchPlainScalar in Scanner class taking up a lot of responsibility and glues up a lot of mixed concerns (from all kinds of plain styles) in one place; which makes it harder to comprehend, if not impossible.

In particular, YAML 1.2 §7.3.3 talks about plain style of flow scalars, that is more restrictive than the $other plain styles of other scalars, and other styles of flow scalars. For the other two flow scalar styles (single and double quoted), we have a dedicated method FetchFlowScalar(bool isSingleQuoted), but for plain style the control flow either resorts to FetchValue, or (like in case of 5T43's fix) to FetchPlainScalar. IMHO, we should try to refactor flow scalar's plain style by changing its method's signature to FetchFlowScalar(bool isQuoted, bool isSingleQuoted) and implement its rules there. It might result in a little code duplication but much cleaner and implementation would be easily relatable with the spec, 1:1.

Similarly, for other kinds of plain styles, they could be structured in their corresponding parent concern and hence made relatable to the spec.


However, I believe priority 1 is correctness. Refactorings / optimizations can wait. I just wanted to record this message as the pain of finding the problem and my wounds therefore, are fresh at the moment. 8-)
Maybe someone has time to undergo this (very targetted) refactoring. My hands are full with stuff like real life, work and tracking down why JR7V and other are failing.. 🤣

@aaubry aaubry mentioned this pull request Apr 29, 2022
@EdwardCooke
Copy link
Collaborator

I have updated the yaml tests cases to the latest available and fixed all broken tests. Thanks for your work.

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.

None yet

2 participants