Skip to content

Commit

Permalink
šŸ› fix(docs_test.go): add comment to clarify the purpose of normalizinā€¦
Browse files Browse the repository at this point in the history
ā€¦g newlines in test
  • Loading branch information
tarampampam committed Apr 14, 2023
1 parent 33ea5a2 commit e2824a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestToTabularToFileBetweenTags(t *testing.T) {
expectedDocs, fErr := os.ReadFile("testdata/expected-tabular-markdown-full.md")
expect(t, fErr, nil) // read without error

// normalizes \r\n (windows) and \r (mac) into \n (unix)
// normalizes \r\n (windows) and \r (mac) into \n (unix) (required for tests to pass on windows)
var normalizeNewlines = func(d []byte) []byte {
d = bytes.Replace(d, []byte{13, 10}, []byte{10}, -1) // replace CR LF \r\n (windows) with LF \n (unix)
d = bytes.Replace(d, []byte{13}, []byte{10}, -1) // replace CF \r (mac) with LF \n (unix)
Expand Down

0 comments on commit e2824a8

Please sign in to comment.