1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Initial commit

This commit is contained in:
Darren Shepherd
2015-02-08 21:38:37 -07:00
commit df4a126175
38 changed files with 1351 additions and 0 deletions

29
config/config_test.go Normal file
View File

@@ -0,0 +1,29 @@
package config
import (
"testing"
"code.google.com/p/rog-go/deepdiff"
)
func TestParseCmdline(t *testing.T) {
expected := map[string]interface{}{
"rescue": true,
"key1": "value1",
"key2": "value2",
"obj1": map[string]interface{}{
"key3": "3value",
"obj2": map[string]interface{}{
"key4": true,
},
},
"key5": 5,
}
actual := parseCmdline("a b rancher.rescue rancher.key1=value1 c rancher.key2=value2 rancher.obj1.key3=3value rancher.obj1.obj2.key4 rancher.key5=5")
ok, err := deepdiff.DeepDiff(actual, expected)
if !ok || err != nil {
t.Fatal(err)
}
}