Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danafallon committed Jun 25, 2024
1 parent f544aa6 commit 70648ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/optimization/table_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ func (t *TableData) InsertRow(pk string, rowData map[string]any, delete bool) {
var prevRowSize int
prevRow, isOk := t.rowsData[pk]
if isOk {
prevRowSize = size.GetApproxSize(prevRow)
if delete {
// if the row was deleted, copy the previous values and just update the deleted flag
rowData = prevRow
rowData[constants.DeleteColumnMarker] = true
} else {
prevRowSize = size.GetApproxSize(prevRow)
for key, val := range rowData {
if val == constants.ToastUnavailableValuePlaceholder {
// Copy it from prevRow.
Expand Down
4 changes: 2 additions & 2 deletions lib/optimization/table_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ func TestTableData_InsertRowIntegrity(t *testing.T) {
assert.False(t, td.ContainOtherOperations())

for i := 0; i < 100; i++ {
td.InsertRow("123", nil, true)
td.InsertRow("123", map[string]any{}, true)
assert.False(t, td.ContainOtherOperations())
}

for i := 0; i < 100; i++ {
td.InsertRow("123", nil, false)
td.InsertRow("123", map[string]any{}, false)
assert.True(t, td.ContainOtherOperations())
}
}

0 comments on commit 70648ec

Please sign in to comment.