KenKundert / nestedtext_tests

5 stars 2 forks source link

Rename 'dump_in.py' -> 'dump_in.json' (fixing assumed error) #2

Closed LewisGaul closed 3 years ago

kalekundert commented 3 years ago

These are in fact not errors. The issue with dict_02 is that JSON does not allow keys with newlines, and the issue with dict_22 is that JSON does not allow non-string keys. So we decided to simply represent these test cases using python. Our intention regarding other languages was that they could either (i) just ignore these test cases or (ii) provide their own dump_in.xxx files with the appropriate literals.

It might be good to add README files to those specific test cases explaining the complication, though. It's briefly mentioned in the main README, but it's easy to miss.

LewisGaul commented 3 years ago

Ahh I should have looked more closely :)

For Zig, I think I can add a dump_in.zig for the key with a newline case, but it's impossible to represent a NestedText value that has a non-string key so that testcase can be skipped.