label: Invalidate empty or invalid value labels

This commit is contained in:
kargakis
2015-05-20 11:02:30 +02:00
parent 6fa2777e26
commit fb63ab63bb
4 changed files with 16 additions and 4 deletions

View File

@@ -125,6 +125,14 @@ func TestParseLabels(t *testing.T) {
labels: []string{"a=b", "c=d", "a-"},
expectErr: true,
},
{
labels: []string{"a="},
expectErr: true,
},
{
labels: []string{"a=%^$"},
expectErr: true,
},
}
for _, test := range tests {
labels, remove, err := parseLabels(test.labels)