Require explicit module execution classes
This commit is contained in:
@@ -46,10 +46,11 @@ func TestInputAdapterRegistryRegisterAndBuildTrimKeys(t *testing.T) {
|
||||
func TestInputAdapterRegistryRegisterWithSpecStoresMetadata(t *testing.T) {
|
||||
registry := NewInputAdapterRegistry()
|
||||
spec := ModuleSpec{
|
||||
Key: " generic-input ",
|
||||
Stage: StageInput,
|
||||
Provides: []string{" parsed-source ", "source-document", "parsed-source", ""},
|
||||
Requires: []string{" raw-bytes ", "raw-bytes", ""},
|
||||
Key: " generic-input ",
|
||||
Stage: StageInput,
|
||||
ExecutionClass: contracts.ExecutionClassDeterministic,
|
||||
Provides: []string{" parsed-source ", "source-document", "parsed-source", ""},
|
||||
Requires: []string{" raw-bytes ", "raw-bytes", ""},
|
||||
}
|
||||
|
||||
if err := registry.RegisterWithSpec(spec, fakeInputAdapterConstructor("generic-input")); err != nil {
|
||||
@@ -101,7 +102,7 @@ func TestInputAdapterRegistryRegisterStoresDefaultSpec(t *testing.T) {
|
||||
func TestInputAdapterRegistryRegisterWithSpecRejectsWrongStage(t *testing.T) {
|
||||
registry := NewInputAdapterRegistry()
|
||||
|
||||
err := registry.RegisterWithSpec(ModuleSpec{Key: "generic-input", Stage: StageExtract}, fakeInputAdapterConstructor("generic-input"))
|
||||
err := registry.RegisterWithSpec(ModuleSpec{Key: "generic-input", Stage: StageExtract, ExecutionClass: contracts.ExecutionClassDeterministic}, fakeInputAdapterConstructor("generic-input"))
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("RegisterWithSpec() error = nil, want error")
|
||||
|
||||
Reference in New Issue
Block a user