aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libvirt/utils_domain_def_test.go34
1 files changed, 16 insertions, 18 deletions
diff --git a/libvirt/utils_domain_def_test.go b/libvirt/utils_domain_def_test.go
index b497c02c..4880804e 100644
--- a/libvirt/utils_domain_def_test.go
+++ b/libvirt/utils_domain_def_test.go
@@ -12,25 +12,23 @@ func init() {
}
func TestSplitKernelCmdLine(t *testing.T) {
- {
- e := []map[string]string{{"foo": "bar"}, {"foo": "bar", "key": "val"}}
- r, err := splitKernelCmdLine("foo=bar foo=bar key=val")
- if !reflect.DeepEqual(r, e) {
- t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), spew.Sdump(e))
- }
- if err != nil {
- t.Error(err)
- }
+ e := []map[string]string{{"foo": "bar"}, {"foo": "bar", "key": "val"}}
+ r, err := splitKernelCmdLine("foo=bar foo=bar key=val")
+ if !reflect.DeepEqual(r, e) {
+ t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), spew.Sdump(e))
}
+ if err != nil {
+ t.Error(err)
+ }
+}
- {
- v := "foo=barfoo=bar"
- r, err := splitKernelCmdLine(v)
- if r != nil {
- t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), err)
- }
- if err == nil {
- t.Errorf("Expected error for parsing '%s'", v)
- }
+func TestSplitKernelInvalidCmdLine(t *testing.T) {
+ v := "foo=barfoo=bar"
+ r, err := splitKernelCmdLine(v)
+ if r != nil {
+ t.Fatalf("got='%s' expected='%s'", spew.Sdump(r), err)
+ }
+ if err == nil {
+ t.Errorf("Expected error for parsing '%s'", v)
}
}