Skip to content

Commit b25731e

Browse files
authored
Fix keepLimitedContentHistory unit test
1 parent 0dc7e5c commit b25731e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/issues/content_history_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ func TestContentHistory(t *testing.T) {
6868
assert.EqualValues(t, 6, h6.ID)
6969
assert.EqualValues(t, 4, h6Prev.ID)
7070

71-
// only keep 3 history revisions for comment_id=100
71+
// only keep 3 history revisions for comment_id=100, the first and the last should never be deleted
7272
keepLimitedContentHistory(dbEngine, 10, 100, 3)
7373
list1, _ = FetchIssueContentHistoryList(dbCtx, 10, 0)
7474
assert.Len(t, list1, 3)
7575
list2, _ = FetchIssueContentHistoryList(dbCtx, 10, 100)
7676
assert.Len(t, list2, 3)
77-
assert.EqualValues(t, 7, list2[0].HistoryID)
78-
assert.EqualValues(t, 6, list2[1].HistoryID)
77+
assert.EqualValues(t, 8, list2[0].HistoryID)
78+
assert.EqualValues(t, 7, list2[1].HistoryID)
7979
assert.EqualValues(t, 4, list2[2].HistoryID)
8080
}

0 commit comments

Comments
 (0)