Remove disconnected facade clone scaffolding
This commit is contained in:
@@ -27,7 +27,7 @@ func TestOverlayPublicValues(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSourceInfoDestinationConversionsAndCopies(t *testing.T) {
|
||||
func TestSourceInfoDestinationConversion(t *testing.T) {
|
||||
destination := Keys("collections", "a/b", "0")
|
||||
path := writeRecordConfig(t, "value: main\n")
|
||||
options := engine.OptionsWithPlacement(engine.Options[map[string]any]{}, engine.Keys("collections", "a/b", "0"), uint8(PlacementModeSequenceItem))
|
||||
@@ -36,14 +36,9 @@ func TestSourceInfoDestinationConversionsAndCopies(t *testing.T) {
|
||||
if converted.Destination.String() != destination.String() || converted.PlacementMode != PlacementModeSequenceItem || converted.DestinationUnresolved {
|
||||
t.Fatalf("public source evidence = %#v", converted)
|
||||
}
|
||||
copy := cloneSourceInfo(converted)
|
||||
copy.Destination = Path{}
|
||||
if converted.Destination.String() != destination.String() {
|
||||
t.Fatalf("source record destination changed through clone: %q", converted.Destination.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestSourceVersionCheckConversionsAndCopies(t *testing.T) {
|
||||
func TestSourceVersionCheckConversion(t *testing.T) {
|
||||
path := Keys("version")
|
||||
file := writeRecordConfig(t, "version: '123'\nvalue: main\n")
|
||||
options := engine.Options[recordConfig]{
|
||||
@@ -67,18 +62,9 @@ func TestSourceVersionCheckConversionsAndCopies(t *testing.T) {
|
||||
converted.VersionCheck.Location == nil || converted.VersionCheck.Location.SourceID != internal.ID || converted.VersionCheck.Location.Line != 1 {
|
||||
t.Fatalf("public source version check = %#v", converted.VersionCheck)
|
||||
}
|
||||
copy := cloneSourceInfo(converted)
|
||||
copy.VersionCheck.Path = Keys("changed")
|
||||
copy.VersionCheck.Version.Text = "changed"
|
||||
copy.VersionCheck.Location.Line = 99
|
||||
copy.VersionCheck.Redacted = true
|
||||
if converted.VersionCheck.Path.String() != path.String() || converted.VersionCheck.Version.Text != "123" ||
|
||||
converted.VersionCheck.Location.Line != 1 || converted.VersionCheck.Redacted {
|
||||
t.Fatalf("source version check changed through a detached copy: %#v", converted.VersionCheck)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportSelectionConversionsAndCopies(t *testing.T) {
|
||||
func TestImportSelectionConversion(t *testing.T) {
|
||||
file := writeRecordConfig(t, "configkit:\n imports:\n - glob: absent/*.yml\nvalue: main\n")
|
||||
internal := engineSourceInfoFromLoad(t, file, "source-1", engine.Options[recordConfig]{Imports: true})
|
||||
converted := fromEngineSourceInfo(internal)
|
||||
@@ -87,12 +73,6 @@ func TestImportSelectionConversionsAndCopies(t *testing.T) {
|
||||
converted.ImportSelections[0].Selector != ImportSelectorGlob || converted.ImportSelections[0].Outcome != ImportSelectionNone {
|
||||
t.Fatalf("converted selection evidence = %#v", converted.ImportSelections)
|
||||
}
|
||||
copy := cloneSourceInfo(converted)
|
||||
copy.ImportSelections[0].Path = Keys("copy")
|
||||
copy.ImportSelections[0].Selector = ImportSelectorPath
|
||||
if converted.ImportSelections[0].Path.String() != "/configkit/imports/0" || converted.ImportSelections[0].Selector != ImportSelectorGlob {
|
||||
t.Fatalf("source selection evidence changed through copy: %#v", converted.ImportSelections)
|
||||
}
|
||||
if converted.ImportSelections[0].Outcome != ImportSelectionNone {
|
||||
t.Fatalf("source selection outcome = %q", converted.ImportSelections[0].Outcome)
|
||||
}
|
||||
@@ -102,10 +82,6 @@ func TestImportSelectionConversionsAndCopies(t *testing.T) {
|
||||
if fromEngineImportSelections([]engine.ImportSelectionForFacade{}) == nil {
|
||||
t.Fatal("converting an empty engine selection slice returned nil")
|
||||
}
|
||||
empty := cloneSourceInfo(SourceInfo{ImportSelections: make([]ImportSelection, 0)})
|
||||
if empty.ImportSelections == nil {
|
||||
t.Fatal("cloning collapsed a non-nil empty selection slice")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOverrideConversionsPreserveSliceShapeAndCopyRecords(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user