KenKundert / nestedtext_tests

5 stars 2 forks source link

Test `string_8` has no indicator it should use DOS-style newlines #11

Open fidian opened 1 month ago

fidian commented 1 month ago

If a testing framework only looks at dump_in.json, there is no indicator there to determine the output newline format should be DOS-style. If trying to exactly match the tests, this test will break if it there's no other source for information. Currently I implement this check by looking at the expected output and if it has "\r\n" then set the newlines to "\r\n" for the library.

I would propose that dump_in.json would be written using "\r\n" at the end so that one file could solely be the source of input. Alternately, update the test so dump_out.nt only use "\n" and presume all newlines are CR.