Remove redundant prepared input APIs
This commit is contained in:
@@ -53,7 +53,6 @@ type Source struct {
|
||||
// ScriptoriumInputSourceDescriptor describes one validated Scriptorium input source.
|
||||
type ScriptoriumInputSourceDescriptor struct {
|
||||
Source Source
|
||||
PreparedInput *PreparedInputSourceDescriptor
|
||||
PreviousSession *PreviousSessionSourceDescriptor
|
||||
}
|
||||
|
||||
@@ -170,8 +169,7 @@ func DescribeScriptoriumInputSource(source string) (ScriptoriumInputSourceDescri
|
||||
}
|
||||
if prepared, ok := DescribePreparedInputSource(trimmed); ok {
|
||||
return ScriptoriumInputSourceDescriptor{
|
||||
Source: Source{ID: prepared.SourceID, Kind: SourceKindStableInput},
|
||||
PreparedInput: &prepared,
|
||||
Source: Source{ID: prepared.SourceID, Kind: SourceKindStableInput},
|
||||
}, nil
|
||||
}
|
||||
if strings.HasPrefix(trimmed, "narratio.previous_session.artifact") {
|
||||
@@ -196,13 +194,6 @@ func DescribeScriptoriumInputSource(source string) (ScriptoriumInputSourceDescri
|
||||
return ScriptoriumInputSourceDescriptor{Source: classified}, nil
|
||||
}
|
||||
|
||||
// IsStableInputSource reports whether source is a prepared stable input source
|
||||
// available only to Scriptorium input resolution.
|
||||
func IsStableInputSource(source string) bool {
|
||||
_, ok := DescribePreparedInputSource(source)
|
||||
return ok
|
||||
}
|
||||
|
||||
var preparedInputSources = map[string]PreparedInputSourceDescriptor{
|
||||
SourceInputPlayers: {
|
||||
SourceID: SourceInputPlayers,
|
||||
|
||||
@@ -233,14 +233,6 @@ func TestDescribePreparedInputSource(t *testing.T) {
|
||||
if descriptor.SourceID != tt.source || descriptor.ManifestKind != tt.manifestKind || descriptor.Filename != tt.filename {
|
||||
t.Fatalf("DescribePreparedInputSource(%q) = %#v", tt.source, descriptor)
|
||||
}
|
||||
|
||||
scriptoriumDescriptor, err := DescribeScriptoriumInputSource(tt.source)
|
||||
if err != nil {
|
||||
t.Fatalf("DescribeScriptoriumInputSource(%q) error = %v", tt.source, err)
|
||||
}
|
||||
if scriptoriumDescriptor.PreparedInput == nil || *scriptoriumDescriptor.PreparedInput != descriptor {
|
||||
t.Fatalf("prepared input descriptor = %#v, want %#v", scriptoriumDescriptor.PreparedInput, descriptor)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user