refactor(test): remove redundant beginTableCalled variable

Remove standalone beginTableCalled variable in
TestLazyRowWriter_NoRowsWritten test function. The test now
uses mockDW.beginTableCalled directly, which maintains consistency
with other test functions (TestLazyRowWriter_RowsWritten and
TestLazyRowWriter_CombinedRowsWritten) that already follow
this pattern.
This commit is contained in:
David Dansby
2025-12-10 17:29:21 -08:00
parent 8db3a9c253
commit 289bff506c

View File

@@ -402,9 +402,7 @@ func TestLazyRowWriter_NoRowsWritten(t *testing.T) {
mockDW := &mockDiffWriter{}
realWriter := &mockRowWriter{}
beginTableCalled := false
onFirstWrite := func() error {
beginTableCalled = true
return mockDW.BeginTable("fromTable", "toTable", false, false)
}
@@ -417,7 +415,7 @@ func TestLazyRowWriter_NoRowsWritten(t *testing.T) {
}
// BeginTable should NEVER have been called
if beginTableCalled {
if mockDW.beginTableCalled {
t.Error("BeginTable() was called even though no rows were written - should have been lazy!")
}
}