Use production directive extraction in import tests
This commit is contained in:
@@ -224,11 +224,11 @@ func parseImportSpecsYAML(t *testing.T, declarations string) ([]importDeclaratio
|
||||
if len(diagnostics) != 0 {
|
||||
return nil, diagnostics
|
||||
}
|
||||
index := documentEntryIndex(parsed.document.Mapping, directiveKey)
|
||||
if index < 0 {
|
||||
t.Fatal("missing root directive in test fixture")
|
||||
extracted, diagnostics := extractRootDirectives(parsed.document, rootDirectiveContextSource)
|
||||
if len(diagnostics) != 0 {
|
||||
return nil, diagnostics
|
||||
}
|
||||
return parseImportSpecificationDirective(parsed.document.Mapping[index].Value, Keys(directiveKey))
|
||||
return extracted.imports, nil
|
||||
}
|
||||
|
||||
type countingImportSpecReader struct {
|
||||
|
||||
Reference in New Issue
Block a user