Consolidate import request ownership
This commit is contained in:
@@ -216,9 +216,8 @@ func TestImportedEmptyBodiesChargeFullRelativeDestinations(t *testing.T) {
|
||||
currentLimits := limits
|
||||
currentLimits.nodes = wantNodes + test.delta
|
||||
accounting := &importAccounting{}
|
||||
composed, sources, diagnostics := loadImportedDocumentsTracked(
|
||||
File(mainPath), nil, main, entryDestination, nil, currentLimits, accounting, nil, nil,
|
||||
)
|
||||
request := testImportRequest(File(mainPath), nil, main, entryDestination, nil, nil)
|
||||
composed, sources, diagnostics := testAcquireImportWithAccounting(request, currentLimits, accounting)
|
||||
if test.wantError {
|
||||
if composed != nil || len(diagnostics) != 1 || diagnostics[0].Code != CodeImportLimitExceeded {
|
||||
t.Fatalf("below-bound relative placement = %#v, %#v", composed, diagnostics)
|
||||
@@ -279,9 +278,8 @@ func TestGlobMatchesChargeTheirSharedRelativeDestination(t *testing.T) {
|
||||
currentLimits := limits
|
||||
currentLimits.nodes = wantNodes + test.delta
|
||||
accounting := &importAccounting{}
|
||||
composed, sources, diagnostics := loadImportedDocumentsTracked(
|
||||
File(mainPath), nil, main, entryDestination, nil, currentLimits, accounting, nil, nil,
|
||||
)
|
||||
request := testImportRequest(File(mainPath), nil, main, entryDestination, nil, nil)
|
||||
composed, sources, diagnostics := testAcquireImportWithAccounting(request, currentLimits, accounting)
|
||||
if test.wantError {
|
||||
if composed != nil || len(diagnostics) != 1 || diagnostics[0].Code != CodeImportLimitExceeded {
|
||||
t.Fatalf("below-bound glob placement = %#v, %#v", composed, diagnostics)
|
||||
@@ -366,9 +364,8 @@ func TestAbsentOptionalImportsDoNotChargeUnusedDeepDestinations(t *testing.T) {
|
||||
main := parseImportMain(t, mainPath)
|
||||
limits := defaultImportLimits()
|
||||
accounting := &importAccounting{}
|
||||
composed, sources, diagnostics := loadImportedDocumentsTracked(
|
||||
File(mainPath), nil, main, destination, nil, limits, accounting, nil, nil,
|
||||
)
|
||||
request := testImportRequest(File(mainPath), nil, main, destination, nil, nil)
|
||||
composed, sources, diagnostics := testAcquireImportWithAccounting(request, limits, accounting)
|
||||
if len(diagnostics) != 0 || composed == nil || len(sources) != 1 {
|
||||
t.Fatalf("absent optional import = %#v, %#v, %#v", composed, sources, diagnostics)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user