1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/utils/jsonmessage_test.go
Victor Vieux d3cc558d14 add test
2013-11-28 16:28:31 -08:00

24 lines
476 B
Go

package utils
import (
"testing"
)
func TestError(t *testing.T) {
je := JSONError{404, "Not found"}
if je.Error() != "Not found" {
t.Fatalf("Expected 'Not found' got '%s'", je.Error())
}
}
func TestProgress(t *testing.T) {
jp := JSONProgress{0, 0, 0}
if jp.String() != "" {
t.Fatalf("Expected empty string, got '%s'", jp.String())
}
jp2 := JSONProgress{1, 0, 0}
if jp2.String() != " 1 B/?" {
t.Fatalf("Expected ' 1/?', got '%s'", jp2.String())
}
}