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

Make LilyPond tests round-trip to test encoding #154

Open
jsbean opened this issue Oct 13, 2019 · 2 comments
Open

Make LilyPond tests round-trip to test encoding #154

jsbean opened this issue Oct 13, 2019 · 2 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@jsbean
Copy link
Member

jsbean commented Oct 13, 2019

We currently only test that we can decode the LilyPond test suite without throwing errors. Now, let's up the ante by making the LilyPond tests perform the following maneuver:

  • Decode MusicXML files from LilyPond test suite
  • Encode the decoded MusicXML model
  • Re-decode the encoded MusicXML data
  • Compare the originally decoded and re-decoded MusicXML model
@jsbean jsbean added this to the 0.3.0 milestone Oct 13, 2019
@jsbean jsbean added the help wanted Extra attention is needed label Oct 13, 2019
@DJBen
Copy link
Collaborator

DJBen commented Oct 17, 2019

I've tried a bit round-trip testing for custom examples, and I found that the current state of XMLCoder does not support pretty printing - meaning the model -> xml conversion is never going to be the same as the original xml.

Neither we have any tools to trim all spaces between element tags reliably for xml, so we cannot compare the trimmed version of xml to the generated xml.

@jsbean
Copy link
Member Author

jsbean commented Oct 17, 2019

You can set XMLEncoder.outputFormatting = .prettyPrinted.

That said, I don’t think we need to test the concrete encoded values directly. Instead, we should test the semantics of the decoded to the decoded-encoded-decoded values.

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

2 participants