From b39689393ccb8434d9a57658a64b77568c718e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 9 Apr 2017 10:33:04 +0200 Subject: hugolib: Enable nested sections Fixes #465 --- hugolib/site_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'hugolib/site_test.go') diff --git a/hugolib/site_test.go b/hugolib/site_test.go index 92aea4d4d..2ef7b56d9 100644 --- a/hugolib/site_test.go +++ b/hugolib/site_test.go @@ -438,7 +438,7 @@ func doTestSectionNaming(t *testing.T, canonify, uglify, pluralize bool) { mainSections, err := s.Info.Param("mainSections") require.NoError(t, err) - require.Equal(t, mainSections, []string{"sect"}) + require.Equal(t, []string{"sect"}, mainSections) th := testHelper{s.Cfg, s.Fs, t} tests := []struct { @@ -635,12 +635,8 @@ func TestOrderedPages(t *testing.T) { s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{SkipRender: true}) - if s.Sections["sect"][0].Weight != 2 || s.Sections["sect"][3].Weight != 6 { - t.Errorf("Pages in unexpected order. First should be '%d', got '%d'", 2, s.Sections["sect"][0].Weight) - } - - if s.Sections["sect"][1].Page.Title != "Three" || s.Sections["sect"][2].Page.Title != "Four" { - t.Errorf("Pages in unexpected order. Second should be '%s', got '%s'", "Three", s.Sections["sect"][1].Page.Title) + if s.getPage(KindSection, "sect").Pages[1].Title != "Three" || s.getPage(KindSection, "sect").Pages[2].Title != "Four" { + t.Error("Pages in unexpected order.") } bydate := s.RegularPages.ByDate() -- cgit v1.2.3