pkg/units: Updated tests with unit constants

Also, now that I was at it, gave them a small refactor.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
This commit is contained in:
Francisco Carriedo 2014-07-26 19:48:02 -07:00
parent 804ea3b58e
commit 2261fc98e1
2 changed files with 75 additions and 76 deletions

View file

@ -44,9 +44,3 @@ func TestHumanDuration(t *testing.T) {
assertEquals(t, "2.010959 years", HumanDuration(24*month+2*week))
assertEquals(t, "3.164384 years", HumanDuration(3*year+2*month))
}
func assertEquals(t *testing.T, expected, actual interface{}) {
if expected != actual {
t.Errorf("Expected '%s' but got '%s'", expected, actual)
}
}