-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
CLI toml-test decoder #125
Comments
There's no toml-test decoder for toml++ currently, though my test suite consumes the test inputs from toml-test and generates C++ unit tests to validate using the test suite, e.g.: conformance_burntsushi_valid.cpp I update the conformance tests every time I do any work on the library so it's generally up-to-date. "Why did you bother writing a C++ code generator and not just provide an encoder/decoder?", I hear you ask. It made sense at the time. Third-party libs in C++ can be very annoying, with or without CMake and friends, so in the early days of toml++ this approach seemed easier. I am going to do another batch of toml++ work at some point in January so if I get time I'll revisit this. |
I'm not advocating that you stop generating unit tests. Every(?) TOML package I've looked at generates local unit tests from the suite. However, I've only found 5 packages that have a I find a |
Oh, certainly. I didn't think you were. Apologies if I gave you that impression. Was just explaining why this repo does the seemingly-harder thing first, instead of the probably-easier-thing, heh. I do see the appeal. There's even a few tests I have to manually skip the code generation for because various C++ compilers don't like the in-code equivalent (e.g. GCC doesn't like whitespace after a trailing |
…ML to streams also: - added `date_time` converting constructors from `date` and `time` - added `is_key<>` and is_key_or_convertible<>` metafunctions - exposed `TOML_NAMESPACE_START` and `TOML_NAMESPACE_END` macros to help with ADL specialization scenarios - added encoder and decoder for `toml-test` (closes #125)
@moorereason I've implemented this in the v3 branch - see v3/toml-test for setup info.
Just re-read this. How do you figure that? It certainly isn't true for the C++ TOML ecosystem. In fact toml++ is the only one that chose that route, as far as I can tell - the others (the still-maintained ones, at least) appear to have done the sensible in the first place and built toml-test decoders 😄 In any case, toml++ has now joined the club and provided both an encoder and decoder for |
Sweet! I'm trying to get through my existing corpus, and I'm getting a UTF-8 error on a case. Given an input of
Not sure what to do with that. |
O_o Are you using any custom tests that aren't currently a part of toml-test? I built it from master today and didn't experience that. If so, can you share the toml/json files? |
Yes, but I'm doing differential fuzzing against other The TOML document in question is 10 characters long:
I've tested that input with 6 other decoders (in Go, C99, C++, Fortran, and Dart), and they all return valid and equal results. |
Oh, right, fuzzing. Ok well I'll do some digging and see what's going on. |
Ah, I see, it's the JSON library I'm using. Doesn't like the JSON generated from that snippet. Guess I need to RTFM to figure out why 😅 |
@moorereason That's fixed now in the v3 branch. |
Oh, since you're adding new upstream tests to toml-test, you might like to know that the unicode-related crash in the JSON lib was actually caused by my lib converting the unicode scalar escape sequence I had some unit tests in place for those conversions but they weren't broad enough. I've added a bunch more now: tomlplusplus/tests/user_feedback.cpp Lines 196 to 211 in b41e12f
|
Is your feature request related to a problem? Please describe.
I've been doing differential fuzzing against a few TOML decoders to see where they may handle inputs differently. I would like to add
tomlplusplus
into the mix.Describe the solution you'd like
Can
tomlplusplus
provide a CLItoml-test
decoder? The decoder takes a given TOML input via STDIN and outputs annotated JSON to STDOUT. Details are in thetoml-test
README.Additional context
I've filed several bug reports in other projects and submitted new test cases to
toml-test
based upon this fuzzing.Thanks for considering.
The text was updated successfully, but these errors were encountered: