filters: clean up implementation
Address a few cleanup items in the parser. Currently, we don't handle compound values and we remove a panic when part of the input is not consumed. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -56,6 +56,12 @@ func TestFilters(t *testing.T) {
|
||||
Name: "bazo",
|
||||
Other: "abc",
|
||||
},
|
||||
{
|
||||
Name: "compound",
|
||||
Labels: map[string]string{
|
||||
"foo": "omg_asdf.asdf-qwer",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var corpus []interface{}
|
||||
@@ -103,6 +109,7 @@ func TestFilters(t *testing.T) {
|
||||
expected: []interface{}{
|
||||
corpus[0],
|
||||
corpus[2],
|
||||
corpus[8],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -112,6 +119,13 @@ func TestFilters(t *testing.T) {
|
||||
corpus[0],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LabelValuePunctuated",
|
||||
input: "labels.foo==omg_asdf.asdf-qwer",
|
||||
expected: []interface{}{
|
||||
corpus[8],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Name",
|
||||
input: "name==bar",
|
||||
@@ -130,6 +144,7 @@ func TestFilters(t *testing.T) {
|
||||
corpus[5],
|
||||
corpus[6],
|
||||
corpus[7],
|
||||
corpus[8],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user