Expose input destinations through the public facade
This commit is contained in:
@@ -20,3 +20,21 @@ func TestOverlayPublicValues(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSourceInfoDestinationConversionsAndCopies(t *testing.T) {
|
||||
destination := Keys("collections", "a/b", "0")
|
||||
public := SourceInfo{ID: "source-1", Destination: destination}
|
||||
internal := toEngineSourceInfo(public)
|
||||
if internal.Destination.String() != destination.String() {
|
||||
t.Fatalf("engine destination = %q, want %q", internal.Destination.String(), destination.String())
|
||||
}
|
||||
converted := fromEngineSourceInfo(internal)
|
||||
if converted.Destination.String() != destination.String() {
|
||||
t.Fatalf("public destination = %q, want %q", converted.Destination.String(), destination.String())
|
||||
}
|
||||
copy := cloneSourceInfo(converted)
|
||||
copy.Destination = Path{}
|
||||
if converted.Destination.String() != destination.String() {
|
||||
t.Fatalf("source record destination changed through clone: %q", converted.Destination.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user