X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/522d7fd117285e4e4ce3ea5ec9b5a1722521b681..c781f79f3c8cb9a7577ee1574d196988da2719b3:/view_test.go?ds=sidebyside diff --git a/view_test.go b/view_test.go index 46f76da..f771eb2 100644 --- a/view_test.go +++ b/view_test.go @@ -149,14 +149,6 @@ func TestRestoreViewRejectsAGap(t *testing.T) { // ViewBuiltTree is a tree with each node built, with 1 byte of text. type ViewBuiltTree struct{} -func (v ViewBuiltTree) Built(_, _ int) (bool, error) { - return true, nil -} - -func (ViewBuiltTree) Node(level, index int) (Node, bool, error) { - return treeTestNode(level, index, "a"), true, nil -} - // ViewPushEntry is one entry of the rollback state list of the reference // design, newest first. Under push alone, life stays 0, so the entry leaves it // out. @@ -166,6 +158,19 @@ type ViewPushEntry struct { older *ViewPushEntry } +// ViewPartTree is a tree with the built nodes of its sizes. +type ViewPartTree struct { + sizes map[NodeKey]int +} + +func (v ViewBuiltTree) Built(_, _ int) (bool, error) { + return true, nil +} + +func (ViewBuiltTree) Node(level, index int) (Node, bool, error) { + return treeTestNode(level, index, "a"), true, nil +} + // starts returns the states of the list, oldest first. func (e *ViewPushEntry) starts() []int { var starts []int @@ -179,11 +184,6 @@ func (e *ViewPushEntry) starts() []int { return starts } -// ViewPartTree is a tree with the built nodes of its sizes. -type ViewPartTree struct { - sizes map[NodeKey]int -} - func (p ViewPartTree) Built(level, index int) (bool, error) { _, built := p.sizes[NodeKey{level, index}] return built, nil