} {
result := GuessType(this.in)
if result != this.expect {
- t.Errorf("[%d] GuessType guessed wrong, expected %s, got %s", i, this.expect, result)
+ t.Errorf("[%d] got %s but expected %s", i, result, this.expect)
}
}
}
for i, this := range append(containsBenchTestData, containsAdditionalTestData...) {
result := ReaderContains(StringToReader(this.v1), this.v2)
if result != this.expect {
- t.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ t.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
for i, this := range containsBenchTestData {
result := ReaderContains(StringToReader(this.v1), this.v2)
if result != this.expect {
- b.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ b.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
}
}
result := bytes.Contains(bs, this.v2)
if result != this.expect {
- b.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ b.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
}
{"Albert", true},
{"ALBERT", false},
}
- for _, in := range data {
+ for i, in := range data {
output := InStringArray(array, in.input)
if output != in.expected {
- t.Errorf("TestInStringArrayCase failed. Expected %t. Got %t.", in.expected, output)
+ t.Errorf("[%d] got %t but expected %t", i, output, in.expected)
}
}
}
result := probablyEqualPageLists(this.v1, this.v2)
if result != this.expect {
- t.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ t.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
{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 {
}
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)
}
}
}
func TestTemplatePathSeparator(t *testing.T) {
tmpl := new(tpl.GoHTMLTemplate)
if name := tmpl.GenerateTemplateNameFrom(win_base, win_path); name != "sub1/index.html" {
- t.Fatalf("Template name incorrect. Expected: %s, Got: %s", "sub1/index.html", name)
+ t.Fatalf("Template name incorrect. got %s but expected %s", name, "sub1/index.html")
}
}
}
if output != expected {
- t.Fatalf("Shortcode render didn't match. Expected: %q, Got: %q", expected, output)
+ t.Fatalf("Shortcode render didn't match. got %q but exxpected %q", output, expected)
}
}
} else {
r, _ := regexp.Compile(this.expectErrorMsg)
if !r.MatchString(err.Error()) {
- t.Fatalf("[%d] %s: ExtractShortcodes didn't return an expected error message, expected %s got %s",
- i, this.name, this.expectErrorMsg, err.Error())
+ t.Fatalf("[%d] %s: ExtractShortcodes didn't return an expected error message, got %s but expected %s",
+ i, this.name, err.Error(), this.expectErrorMsg)
}
}
continue
}
if !r.MatchString(content) {
- t.Fatalf("[%d] %s: Shortcode extract didn't match. Expected: %q, Got: %q", i, this.name, expected, content)
+ t.Fatalf("[%d] %s: Shortcode extract didn't match. got %q but expected %q", i, this.name, content, expected)
}
for placeHolder, sc := range shortCodes {
if this.expectShortCodes != "" {
shortCodesAsStr := fmt.Sprintf("map%q", collectAndSortShortcodes(shortCodes))
if !strings.Contains(shortCodesAsStr, this.expectShortCodes) {
- t.Fatalf("[%d] %s: Short codes not as expected, got %s - expected to contain %s", i, this.name, shortCodesAsStr, this.expectShortCodes)
+ t.Fatalf("[%d] %s: Short codes not as expected, got %s but expected %s", i, this.name, shortCodesAsStr, this.expectShortCodes)
}
}
}
result := FormatToLeadRune(this.kind)
if result != this.expect {
- t.Errorf("[%d] Got %q but expected %q", i, result, this.expect)
+ t.Errorf("[%d] got %q but expected %q", i, result, this.expect)
}
}
}
result := In(this.v1, this.v2)
if result != this.expect {
- t.Errorf("[%d] Got %v but expected %v", i, result, this.expect)
+ t.Errorf("[%d] got %v but expected %v", i, result, this.expect)
}
}
}
continue
}
if !reflect.DeepEqual(result, this.expect) {
- t.Errorf("[%d] Got %s but expected %s", i, result, this.expect)
+ t.Errorf("[%d] got %s but expected %s", i, result, this.expect)
}
}
}
continue
}
if !reflect.DeepEqual(result, this.expect) {
- t.Errorf("[%d] Got %s but expected %s", i, result, this.expect)
+ t.Errorf("[%d] got %s but expected %s", i, result, this.expect)
}
}
}
continue
}
if !reflect.DeepEqual(result, this.expect) {
- t.Errorf("[%d] Got %s but expected %s", i, result, this.expect)
+ t.Errorf("[%d] got %s but expected %s", i, result, this.expect)
}
}
}
continue
}
if !reflect.DeepEqual(results, this.expect) {
- t.Errorf("[%d] Got %v but expected %v", i, results, this.expect)
+ t.Errorf("[%d] got %v but expected %v", i, results, this.expect)
}
}
_, err1 := Intersect("not an array or slice", []string{"a"})
if err1 == nil {
- t.Error("Excpected error for non array as first arg")
+ t.Error("Expected error for non array as first arg")
}
_, err2 := Intersect([]string{"a"}, "not an array or slice")
if err2 == nil {
- t.Error("Excpected error for non array as second arg")
+ t.Error("Expected error for non array as second arg")
}
}
}
}
}
+