Skip to content

Commit

Permalink
add number key test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksnyder committed Oct 13, 2024
1 parent 90c2b36 commit 2a816a8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions i18n/parse_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package i18n

import (
"errors"
"reflect"
"sort"
"testing"
Expand Down Expand Up @@ -187,6 +188,16 @@ some-keys:
},
},
},
{
name: "YAML number key test",
file: `
some-keys:
hello: world
2: legit`,
path: "en.yaml",
unmarshalFuncs: map[string]UnmarshalFunc{"yaml": yaml.Unmarshal},
err: errors.New("expected key to be string but got 2"),
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
Expand Down

0 comments on commit 2a816a8

Please sign in to comment.