diff options
author | Duncan Mac-Vicar P <dmacvicar@suse.de> | 2017-11-23 14:37:52 +0100 |
---|---|---|
committer | Duncan Mac-Vicar P <dmacvicar@suse.de> | 2017-11-24 17:56:44 +0100 |
commit | 1cbfe466f0fb8c2320c54cec9e54fbdb1d5bd4ac (patch) | |
tree | b78457e70284d923516099846f94b67b984c14ba /libvirt | |
parent | a1145d25f878d0fc70229428c8076c27423d5a07 (diff) | |
download | terraform-provider-libvirt-1cbfe466f0fb8c2320c54cec9e54fbdb1d5bd4ac.tar terraform-provider-libvirt-1cbfe466f0fb8c2320c54cec9e54fbdb1d5bd4ac.tar.gz |
Split kernel cmdline test
Diffstat (limited to 'libvirt')
-rw-r--r-- | libvirt/utils_domain_def_test.go | 34 |
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) } } |