Added test for the empty values array case

This commit is contained in:
Brian Kassouf 2017-02-21 16:02:00 -08:00
parent a25132cec4
commit dd5b541db6
1 changed files with 19 additions and 0 deletions

View File

@ -238,6 +238,7 @@ func TestACL_PolicyMerge(t *testing.T) {
{"deny/all", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}}, {"deny/all", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}},
{"deny/all1", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}}, {"deny/all1", nil, map[string][]interface{}{"*": []interface{}{}, "test": []interface{}{}}},
{"value/merge", map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}, map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}}, {"value/merge", map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}, map[string][]interface{}{"test": []interface{}{1, 2, 3, 4}}},
{"value/empty", map[string][]interface{}{"empty": []interface{}{}}, map[string][]interface{}{"empty": []interface{}{}}},
} }
for _, tc := range tcases { for _, tc := range tcases {
@ -528,6 +529,24 @@ path "value/merge" {
"test" = [3, 4] "test" = [3, 4]
} }
} }
path "value/empty" {
policy = "write"
allowed_parameters = {
"empty" = []
}
denied_parameters = {
"empty" = [1]
}
}
path "value/empty" {
policy = "write"
allowed_parameters = {
"empty" = [1]
}
denied_parameters = {
"empty" = []
}
}
` `
//allow operation testing //allow operation testing