Merge pull request #259 from peco/fix-fmt-specifier

Correct format specifiers
This commit is contained in:
lestrrat 2015-09-15 13:31:10 +09:00
commit d101e12bd4
4 changed files with 7 additions and 7 deletions

View file

@ -185,7 +185,7 @@ func writeQueryToPrompt(t *testing.T, message string) {
t.Logf("End of string reached")
break
}
t.Errorf("Failed to decode run in string: %s", r)
t.Errorf("Failed to decode run in string: %#U", r)
return
}

View file

@ -32,7 +32,7 @@ func TestReadRC(t *testing.T) {
if err := json.Unmarshal([]byte(txt), cfg); err != nil {
t.Fatalf("Error unmarshaling json: %s", err)
}
t.Logf("%#q", cfg)
t.Logf("%#v", cfg)
}
type stringsToStyleTest struct {

View file

@ -58,7 +58,7 @@ func TestLayoutType(t *testing.T) {
for _, l := range layouts {
valid := IsValidLayoutType(l.value)
if valid != l.expectOK {
t.Errorf("LayoutType %s, expected IsValidLayoutType to return %s, but got %s",
t.Errorf("LayoutType %s, expected IsValidLayoutType to return %t, but got %t",
l.value,
l.expectOK,
valid,
@ -74,7 +74,7 @@ func TestPrintScreen(t *testing.T) {
makeVerifier := func(initX, initY int, fill bool) func(string) {
return func(msg string) {
i.reset()
t.Logf("Checking printScreen(%d, %d, %s, %s)", initX, initY, msg, fill)
t.Logf("Checking printScreen(%d, %d, %s, %t)", initX, initY, msg, fill)
width := utf8.RuneCountInString(msg)
printScreen(initX, initY, termbox.ColorDefault, termbox.ColorDefault, msg, fill)
events := i.events["SetCell"]

View file

@ -23,20 +23,20 @@ func TestMergeAttribute(t *testing.T) {
for _, c := range tests {
if m := mergeAttribute(colors[c[0]], colors[c[1]]); m != colors[c[2]] {
t.Errorf("(%s + %s) expected %s, got %s", c[0], c[1], colors[c[2]], m)
t.Errorf("(%s + %s) expected %d(%s), got %d", c[0], c[1], colors[c[2]], c[2], m)
}
}
// merge with white
for _, c := range colors {
if m := mergeAttribute(c, colors["white"]); m != colors["white"] {
t.Errorf("expected white(%s), got %s", colors["white"], m)
t.Errorf("expected white(%d), got %d", colors["white"], m)
}
}
// merge attributes
if m := mergeAttribute(termbox.AttrBold|colors["red"], termbox.AttrUnderline|colors["cyan"]); m != termbox.AttrBold|termbox.AttrUnderline|colors["white"] {
t.Errorf("expected %s, got %s", termbox.AttrBold|termbox.AttrUnderline|colors["white"], m)
t.Errorf("expected %d, got %d", termbox.AttrBold|termbox.AttrUnderline|colors["white"], m)
}
}