Fix (*Ulimit).String() function. Closes #11769.

Signed-off-by: Allen Madsen <blatyo@gmail.com>
Upstream-commit: cb168e5622fefc42df1fa0e355aa5922c74329e8
Component: engine
This commit is contained in:
Allen Madsen
2015-03-25 19:39:05 -04:00
parent 6448734eca
commit 940c2dcc3c
2 changed files with 8 additions and 1 deletions

View File

@ -102,5 +102,5 @@ func (u *Ulimit) GetRlimit() (*Rlimit, error) {
}
func (u *Ulimit) String() string {
return fmt.Sprintf("%s=%s:%s", u.Name, u.Soft, u.Hard)
return fmt.Sprintf("%s=%d:%d", u.Name, u.Soft, u.Hard)
}

View File

@ -39,3 +39,10 @@ func TestParseInvalidValueType(t *testing.T) {
t.Fatal("expected error on bad value type")
}
}
func TestStringOutput(t *testing.T) {
u := &Ulimit{"nofile", 1024, 512}
if s := u.String(); s != "nofile=512:1024" {
t.Fatal("expected String to return nofile=512:1024, but got", s)
}
}