diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-02 13:23:25 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-03 13:12:58 +0100 |
commit | d90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch) | |
tree | 7b1b14464eefec1188ca2eed53c64e4823453cc9 /resources/page/pagination_test.go | |
parent | 32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff) | |
download | hugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.tar.gz hugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.zip |
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'resources/page/pagination_test.go')
-rw-r--r-- | resources/page/pagination_test.go | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/resources/page/pagination_test.go b/resources/page/pagination_test.go index f4441a892..8d4f857d7 100644 --- a/resources/page/pagination_test.go +++ b/resources/page/pagination_test.go @@ -37,7 +37,6 @@ func TestSplitPages(t *testing.T) { lastChunk := chunks[4] c.Assert(lastChunk.Len(), qt.Equals, 1) - } func TestSplitPageGroups(t *testing.T) { @@ -78,7 +77,6 @@ func TestSplitPageGroups(t *testing.T) { } else { t.Fatal("Excepted PageGroup") } - } func TestPager(t *testing.T) { @@ -111,7 +109,6 @@ func TestPager(t *testing.T) { first = pag.Pagers()[0].First() c.Assert(first.PageGroups(), qt.Not(qt.HasLen), 0) c.Assert(first.Pages(), qt.HasLen, 0) - } func doTestPages(t *testing.T, paginator *Paginator) { @@ -171,7 +168,6 @@ func TestPagerNoPages(t *testing.T) { first = paginator.Pagers()[0].First() c.Assert(first.PageGroups(), qt.HasLen, 0) c.Assert(first.Pages(), qt.HasLen, 0) - } func doTestPagerNoPages(t *testing.T, paginator *Paginator) { @@ -195,7 +191,6 @@ func doTestPagerNoPages(t *testing.T, paginator *Paginator) { c.Assert(pageOne.TotalPages(), qt.Equals, 0) c.Assert(pageOne.PageNumber(), qt.Equals, 1) c.Assert(pageOne.PageSize(), qt.Equals, 5) - } func TestPaginationURLFactory(t *testing.T) { @@ -206,7 +201,6 @@ func TestPaginationURLFactory(t *testing.T) { for _, uglyURLs := range []bool{false, true} { c.Run(fmt.Sprintf("uglyURLs=%t", uglyURLs), func(c *qt.C) { - tests := []struct { name string d TargetPathDescriptor @@ -215,10 +209,16 @@ func TestPaginationURLFactory(t *testing.T) { expected string expectedUgly string }{ - {"HTML home page 32", - TargetPathDescriptor{Kind: KindHome, Type: output.HTMLFormat}, "http://example.com/", 32, "/zoo/32/", "/zoo/32.html"}, - {"JSON home page 42", - TargetPathDescriptor{Kind: KindHome, Type: output.JSONFormat}, "http://example.com/", 42, "/zoo/42/index.json", "/zoo/42.json"}, + { + "HTML home page 32", + TargetPathDescriptor{Kind: KindHome, Type: output.HTMLFormat}, + "http://example.com/", 32, "/zoo/32/", "/zoo/32.html", + }, + { + "JSON home page 42", + TargetPathDescriptor{Kind: KindHome, Type: output.JSONFormat}, + "http://example.com/", 42, "/zoo/42/index.json", "/zoo/42.json", + }, } for _, test := range tests { @@ -242,7 +242,6 @@ func TestPaginationURLFactory(t *testing.T) { } }) - } } @@ -276,7 +275,6 @@ func TestProbablyEqualPageLists(t *testing.T) { if result != this.expect { t.Errorf("[%d] got %t but expected %t", i, result, this.expect) - } } } |