pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.67k stars 208 forks source link

use toml-test to generate tests #911

Closed mpldr closed 8 months ago

mpldr commented 8 months ago

This patch enables using toml-test to generate the testfiles. The tests currently generated fail to compile, but as far as I can tell at 12:40 am this seems not to be caused by me. I at least hope it's something trivial to fix.

pelletier commented 8 months ago

Thank you for taking a stab at this!

The tests currently generated fail to compile

Tests don't compile because some of them are generated multiple times in toml_testgen_test.go. For example:

$ ag TestTOMLTest_Invalid_NoClose1
toml_testgen_test.go
38:func TestTOMLTest_Invalid_NoClose1(t *testing.T) {
733:func TestTOMLTest_Invalid_NoClose1(t *testing.T) {
1578:func TestTOMLTest_Invalid_NoClose1(t *testing.T) {
1708:func TestTOMLTest_Invalid_NoClose1(t *testing.T) {

I haven't looked into it but seems like the new way to generate test name isn't unique enough?

mpldr commented 8 months ago

On Thu Oct 26, 2023 at 7:19 PM CEST, Thomas Pelletier wrote:

I haven't looked into it but seems like the new way to generate test name isn't unique enough?

That was also my guess, but I haven't taken a look at the name generation at all.

-- Moritz Poldrack https://moritz.sh

Made with real ingredients.

mpldr commented 8 months ago

Now all issues should be resolved.

pelletier commented 8 months ago

Looking good! Thank you for taking care of this!