1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Update test logs for uniformity and consistency

Many minor fixes to make test logs more consistent and correct a
mispelling.

Standardize on "[%i] got X but expected Y" for log messages. Using
a consistent layout makes it easier to read the test results. This
was mostly changing "Got" to "got". Swapped the order of values on
several calls to bring them in line with the convention.

A few log messages had a sequence number added to identify the
exact scenario that failed. Otherwise, there would be no way to
ascertain which failed When there are many scenarios.

Correct spelling of "expected."

Fixes #1028
Merged be2097e1ad

[close #1040]
This commit is contained in:
bep
2015-04-05 21:03:16 +02:00
committed by spf13
parent 2b91b480d0
commit a52e508d46
7 changed files with 26 additions and 25 deletions

View File

@@ -34,13 +34,13 @@ func TestNewPageWithFilePath(t *testing.T) {
{filepath.Join("content", "dub", "sub", "foobar.html"), "dub", L("dub/single.html", "_default/single.html")},
}
for _, el := range toCheck {
for i, el := range toCheck {
p, err := NewPageFrom(strings.NewReader(SIMPLE_PAGE_YAML), el.input)
if err != nil {
t.Errorf("Reading from SIMPLE_PAGE_YAML resulted in an error: %s", err)
t.Errorf("[%d] Reading from SIMPLE_PAGE_YAML resulted in an error: %s", i, err)
}
if p.Section() != el.section {
t.Errorf("Section not set to %s for page %s. Got: %s", el.section, el.input, p.Section())
t.Errorf("[%d] Section incorrect page %s. got %s but expected %s", i, el.input, p.Section(), el.section)
}
for _, y := range el.layout {
@@ -48,7 +48,7 @@ func TestNewPageWithFilePath(t *testing.T) {
}
if !listEqual(p.Layout(), el.layout) {
t.Errorf("Layout incorrect. Expected: '%s', Got: '%s'", el.layout, p.Layout())
t.Errorf("[%d] Layout incorrect. got '%s' but expected '%s'", i, p.Layout(), el.layout)
}
}
}