Skip to content

Commit

Permalink
Use t.Errorf instead of t.Error+fmt.Sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
marksamman committed Jan 13, 2015
1 parent 8d29b8c commit 41cb09f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestEncodeSinglefileTorrentBencode(t *testing.T) {
res := string(Encode(dict))
expected := "d8:announce41:http://bttracker.debian.org:6969/announce7:comment35:\"Debian CD from cdimage.debian.org\"13:creation datei1391870037e9:httpseedsl85:http://cdimage.debian.org/cdimage/release/7.4.0/iso-cd/debian-7.4.0-amd64-netinst.iso85:http://cdimage.debian.org/cdimage/archive/7.4.0/iso-cd/debian-7.4.0-amd64-netinst.isoe4:infod6:lengthi232783872e4:name30:debian-7.4.0-amd64-netinst.iso12:piece lengthi262144e6:pieces0:ee"
if res != expected {
t.Error(fmt.Sprintf("expected %s\ngot %s", expected, res))
t.Errorf("expected %s\ngot %s", expected, res)
}
}

Expand Down Expand Up @@ -85,7 +85,7 @@ func TestEncodeListOfInts(t *testing.T) {
expected += "i1e"
expected += "ee"
if res != expected {
t.Error(fmt.Sprintf("expected %s\ngot %s", expected, res))
t.Errorf("expected %s\ngot %s", expected, res)
}
}

Expand Down

0 comments on commit 41cb09f

Please sign in to comment.