1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 07:15:41 +00:00

Colons can be parsed without quotes

This commit is contained in:
Josh Curl
2016-09-18 16:35:32 -07:00
parent 2781eab500
commit c1582f5a49
2 changed files with 23 additions and 5 deletions

View File

@@ -122,6 +122,12 @@ func TestParseCmdline(t *testing.T) {
},
}, parseCmdline("rancher.key=a\nb"))
assert.Equal(map[interface{}]interface{}{
"rancher": map[interface{}]interface{}{
"key": "a:b",
},
}, parseCmdline("rancher.key=a:b"))
assert.Equal(map[interface{}]interface{}{
"rancher": map[interface{}]interface{}{
"key": int64(5),
@@ -145,6 +151,12 @@ func TestParseCmdline(t *testing.T) {
"strArray": []interface{}{"url:http://192.168.1.100/cloud-config"},
},
}, parseCmdline("rancher.strArray=[\"url:http://192.168.1.100/cloud-config\"]"))
assert.Equal(map[interface{}]interface{}{
"rancher": map[interface{}]interface{}{
"strArray": []interface{}{"url:http://192.168.1.100/cloud-config"},
},
}, parseCmdline("rancher.strArray=[url:http://192.168.1.100/cloud-config]"))
}
func TestGet(t *testing.T) {