Skip to content

Commit f2c16ad

Browse files
committed
Reapply "buildconfig: disable tests for undecoded keys for now"
This reverts commit c4c3470.
1 parent 7dd9bea commit f2c16ad

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

bib/internal/buildconfig/config.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,11 @@ func decodeTomlBuildConfig(r io.Reader, what string) (*BuildConfig, error) {
5959
dec := toml.NewDecoder(r)
6060

6161
var conf BuildConfig
62-
metadata, err := dec.Decode(&conf)
62+
_, err := dec.Decode(&conf)
6363
if err != nil {
6464
return nil, fmt.Errorf("cannot decode %q: %w", what, err)
6565
}
6666

67-
if len(metadata.Undecoded()) > 0 {
68-
return nil, fmt.Errorf("cannot decode %q: unknown keys found: %v", what, metadata.Undecoded())
69-
}
70-
7167
return &conf, nil
7268
}
7369

bib/internal/buildconfig/config_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,6 @@ func TestReadLegacyJSONConfig(t *testing.T) {
134134
assert.Equal(t, expectedBuildConfig, cfg)
135135
}
136136

137-
func TestTomlUnknownKeysError(t *testing.T) {
138-
fakeUserCnfPath := makeFakeConfig(t, "config.toml", `
139-
[[birds]]
140-
name = "toucan"
141-
`)
142-
_, err := buildconfig.ReadWithFallback(fakeUserCnfPath)
143-
144-
assert.ErrorContains(t, err, "unknown keys found: [birds birds.name]")
145-
}
146-
147137
func TestJsonUnknownKeysError(t *testing.T) {
148138
fakeUserCnfPath := makeFakeConfig(t, "config.json", `
149139
{

0 commit comments

Comments
 (0)