Skip to content

test: wire up toml parser to toml_test_harness#152

Open
CosmicHorrorDev wants to merge 1 commit intonot-fl3:masterfrom
CosmicHorrorDev:toml-test
Open

test: wire up toml parser to toml_test_harness#152
CosmicHorrorDev wants to merge 1 commit intonot-fl3:masterfrom
CosmicHorrorDev:toml-test

Conversation

@CosmicHorrorDev
Copy link
Copy Markdown

hiya 👋. very nice project! i'm planning on using it in a smol static file server that i'm working on

toml_test_harness provides a test harness backed by the official toml_test test vectors. of course there are quite a few failures (over 700 tests after all), but it's easy enough to ignore failures (i tried to group them into categories too)

i'd be more than happy to help fix up some of the bugs too of course :D

...
running 1 test

running 751 tests
iiiii.iii..i.ii..ii.iii......ii..........i.i.iiiiiiiiii..ii............
.iiii.i...iiiiiii.....i.............i...............ii............i....
.ii.iii......iiiii......ii...i..............................ii....i....
.....iiiiii.........i...ii.....iiii.ii.i..ii..i..i.ii.i.ii..i..........
.i.............iiiiiiiiiiiiiiiiiiiii.iii................iiiiiiiiiii.ii.
iiiiiiiiiiiiiiiiiiiiiiii.iii.i...iiiii...ii..............i............i
..iiiii..i......ii..iii.iiiiiii...i..i.i..i......iiii..iiii.i.i.iii....
i..i...ii...i...i.ii.i.i.ii.i.....iiiiiii......iiiiiiiiiiiiiiiiiiii...i
iii.iiii.i...i..iiiiiii.i.i....iiii.i...ii.i......ii.i..iiii.iiiiiiiiii
.ii.iiii.i.ii.iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.i.i.iiiiiii
iii.i.iii.iiii.iii.iiiiiiii.iiiiiiii..ii.
test result: ok. 371 passed; 0 failed; 380 ignored; 0 filtered out; finished in 0.019s
...

@CosmicHorrorDev
Copy link
Copy Markdown
Author

worth mentioning that this is just wiring up the decoding half. there's still encoding to do, but that can be a separate PR

@not-fl3
Copy link
Copy Markdown
Owner

not-fl3 commented Feb 18, 2026

First of all, great work, thanks for PR!
But I am conflicted about this change.

toml_test_harness brings 53 development packages. Compared to nanoserde's 2 - its a big difference. CI will download and compile all those crates all the time and so on.
It only affect nanoserde's developers though, so I would say it is acceptable? But it is still a lot of full-on cargo crates for some tests.

We never intended to support full toml specification - it is a complicated format and for nanoserde the goal for toml was simple ini-like files.
But having more tests is alwasy good and we got quite a lot of new passing tests...

I would say - it is a great tool for development, but I would rather only commit the tests that were helpful during the development in a form of normal #[test].

@CosmicHorrorDev
Copy link
Copy Markdown
Author

We never intended to support full toml specification - it is a complicated format and for nanoserde the goal for toml was simple ini-like files.

that's totally fine! it might be worth adding a note on the README and/or docs.rs page saying that the toml parser (and potentially the others) aren't intended to be spec-compliant


Re: toml-test-harness's deps

yeahhhh, that is quite a few 😅

i might take a stab at a more minimal harness since a lot of the dependencies seem pretty overkill. it should be possible to extract the test vectors in some pre-publishing step and then generate rust code representing them. filtering could use something like regex-lite which has no deps unlike ignore. that'd slim it down to just the harness crate itself and regex-lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants