Test public historical path enumeration

This commit is contained in:
2026-10-25 22:09:55 +00:00
parent 08f2a8f3e9
commit 826062aa17
3 changed files with 71 additions and 17 deletions

View File

@@ -2,7 +2,6 @@ package configkit
import (
"errors"
"reflect"
"strings"
"testing"
@@ -34,19 +33,3 @@ func TestWrappedSourcesPreserveEngineOwnership(t *testing.T) {
t.Fatalf("copied reader source error = %#v", err)
}
}
func TestWrappedPathsRetainEngineSegmentIntent(t *testing.T) {
t.Parallel()
parsed, err := ParsePath("/0")
if err != nil {
t.Fatal(err)
}
keyed, indexed := Keys("0"), Path{}.Index(0)
if parsed.String() != "/0" || keyed.String() != "/0" || indexed.String() != "/0" {
t.Fatalf("path spellings = %q, %q, %q", parsed, keyed, indexed)
}
if reflect.DeepEqual(parsed.value, keyed.value) || reflect.DeepEqual(parsed.value, indexed.value) || reflect.DeepEqual(keyed.value, indexed.value) {
t.Fatal("path wrappers collapsed parsed, mapping-key, and index segments")
}
}