- Module github.com/eslider/go-config with env/yaml/json/ini packages - internal: source, keymap, merge, structconv, bytesutil - cmd/envc: convert, get, merge - docs/asr ASR-0001..0008, README/CHANGELOG/AGENTS refresh - golangci-lint v2 config; tests + fixtures Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
489 B
Go
26 lines
489 B
Go
package keymap
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestLowerAlnum(t *testing.T) {
|
|
if got, want := LowerAlnum("sub-Service"), "subservice"; got != want {
|
|
t.Fatalf("got %q want %q", got, want)
|
|
}
|
|
}
|
|
|
|
func TestWalk(t *testing.T) {
|
|
m := map[string]any{
|
|
"Sub-Service": map[string]any{"Pool-Size": "10"},
|
|
}
|
|
Walk(m, LowerAlnum)
|
|
want := map[string]any{
|
|
"subservice": map[string]any{"poolsize": "10"},
|
|
}
|
|
if !reflect.DeepEqual(m, want) {
|
|
t.Fatalf("got %#v want %#v", m, want)
|
|
}
|
|
}
|