Skip to content

Conversation

@quentinmit
Copy link
Contributor

Before submitting your PR, please confirm the following.

  • Describe the purpose for which you created this PR.
  • Create test code that corresponds to the modification

Current go-yaml will marshal map[string]string{"a": "\tvalue"} as "a: \tvalue" (that is, a literal tab character). Unmarshaling that produces map[string]string{"a": "value"} instead of the original map.

In addition to fixing leading tabs and leading newlines, I also changed TestYAMLTestSuite to round-trip every value to make sure that they can be properly marshaled and unmarshaled without changing the value. This uncovered several broken test cases. All but one are fixed by this PR, since that last one doesn't (primarily, at least) involve whitespace.

This ensures that we can successfully marshal/unmarshal the value.

One test now fails. I marked it as a failing test instead of trying to
figure out how to fix it.
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.00%. Comparing base (25e5d90) to head (32ec83b).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #792      +/-   ##
==========================================
+ Coverage   77.97%   78.00%   +0.03%     
==========================================
  Files          22       22              
  Lines        8108     8108              
==========================================
+ Hits         6322     6325       +3     
+ Misses       1370     1367       -3     
  Partials      416      416              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants