X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/baf7a940be8927278e3b4b87e7366cebfc16532f..087d725b5ab41ad34ffd24938482d45a8b99a080:/view_test.go?ds=inline diff --git a/view_test.go b/view_test.go index 39c8e11..f3d4e2a 100644 --- a/view_test.go +++ b/view_test.go @@ -144,7 +144,7 @@ func TestRestoreViewRejectsAGap(t *testing.T) { // ViewBuiltTree is a tree with each node built, with 1 byte of text. type ViewBuiltTree struct{} -func (ViewBuiltTree) Built(level, index int) (bool, error) { +func (v ViewBuiltTree) Built(_, _ int) (bool, error) { return true, nil } @@ -197,7 +197,11 @@ func (p ViewPartTree) Node(level, index int) (Node, bool, error) { return treeTestNode(level, index, text), true, nil } -// viewPush is the push of rollback_state_list.js. +// viewPush adds state to the newest end of states and returns the new list. An +// empty list gets one entry. When the newest entry is not kept, it becomes kept +// with its own state, and state is dropped. When it is kept, state becomes a +// new newest entry, and the state of the old newest entry goes to the older +// entries by the same push. func viewPush(state int, states *ViewPushEntry) *ViewPushEntry { if states == nil { return &ViewPushEntry{