From 8055838c700d9e8b77ec1dafeda5ecaef2dab2c2 Mon Sep 17 00:00:00 2001 From: spf13 Date: Sat, 28 Dec 2013 13:44:58 -0500 Subject: [PATCH] Allowing empty files (ignored) so you can touch a new file while watching --- hugolib/page_test.go | 6 +++--- parser/parse_frontmatter_test.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hugolib/page_test.go b/hugolib/page_test.go index a308ecef..78d5797d 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -169,11 +169,11 @@ func TestDegenerateEmptyPageZeroLengthName(t *testing.T) { func TestDegenerateEmptyPage(t *testing.T) { _, err := ReadFrom(strings.NewReader(EMPTY_PAGE), "test") - if err == nil { - t.Fatalf("Expected ReadFrom to return an error when an empty buffer is passed.") + if err != nil { + t.Fatalf("Empty files should not trigger an error. Should be able to touch a file while watching without erroring out.") } - checkError(t, err, "EOF") + //checkError(t, err, "EOF") } func checkPageTitle(t *testing.T, page *Page, title string) { diff --git a/parser/parse_frontmatter_test.go b/parser/parse_frontmatter_test.go index 87666542..ab7d78eb 100644 --- a/parser/parse_frontmatter_test.go +++ b/parser/parse_frontmatter_test.go @@ -52,7 +52,6 @@ func TestDegenerateCreatePageFrom(t *testing.T) { tests := []struct { content string }{ - {CONTENT_EMPTY}, {CONTENT_MISSING_END_FM_DELIM}, {CONTENT_INCOMPLETE_END_FM_DELIM}, {CONTENT_FM_NO_DOC}, -- 2.30.2