Add test for successful Ulimit Parse.
Signed-off-by: Allen Madsen <blatyo@gmail.com>
This commit is contained in:
parent
3550131b5e
commit
d5e21d41b8
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,13 @@ package ulimit
|
||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
|
func TestParseValid(t *testing.T) {
|
||||||
|
u1 := &Ulimit{"nofile", 1024, 512}
|
||||||
|
if u2, _ := Parse("nofile=512:1024"); u1 == u2 {
|
||||||
|
t.Fatalf("expected %s, but got %s", u1.String(), u2.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestParseInvalidLimitType(t *testing.T) {
|
func TestParseInvalidLimitType(t *testing.T) {
|
||||||
if _, err := Parse("notarealtype=1024:1024"); err == nil {
|
if _, err := Parse("notarealtype=1024:1024"); err == nil {
|
||||||
t.Fatalf("expected error on invalid ulimit type")
|
t.Fatalf("expected error on invalid ulimit type")
|
||||||
|
|
Loading…
Reference in a new issue