feat(go-config): multi-format codecs, envc CLI, fixtures, ASRs
- 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>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user