mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
a52e508d46
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]
25 lines
401 B
Go
25 lines
401 B
Go
package parser
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestFormatToLeadRune(t *testing.T) {
|
|
for i, this := range []struct {
|
|
kind string
|
|
expect rune
|
|
}{
|
|
{"yaml", '-'},
|
|
{"yml", '-'},
|
|
{"toml", '+'},
|
|
{"json", '{'},
|
|
{"js", '{'},
|
|
{"unknown", '+'},
|
|
} {
|
|
result := FormatToLeadRune(this.kind)
|
|
|
|
if result != this.expect {
|
|
t.Errorf("[%d] got %q but expected %q", i, result, this.expect)
|
|
}
|
|
}
|
|
}
|