mirror of
https://github.com/coredns/coredns.git
synced 2025-10-31 18:23:13 -04:00
plugin/metadata: finish documentation (#1951)
* plugin/metadata: finish documentation Finish the README.md, add corner case in the IsLabel test and reword some code comments slightly. Generate the man-pages and add man/coredns-metadata.7 as well. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix test Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -68,20 +68,23 @@ func TestLabelFormat(t *testing.T) {
|
||||
label string
|
||||
isValid bool
|
||||
}{
|
||||
// ok
|
||||
{"plugin/LABEL", true},
|
||||
{"p/LABEL", true},
|
||||
{"plugin/L", true},
|
||||
// fails
|
||||
{"LABEL", false},
|
||||
{"plugin.LABEL", false},
|
||||
{"/NO-PLUGIN-NOT-ACCEPTED", false},
|
||||
{"ONLY-PLUGIN-NOT-ACCEPTED/", false},
|
||||
{"PLUGIN/LABEL/SUB-LABEL", false},
|
||||
{"/", false},
|
||||
{"//", false},
|
||||
}
|
||||
|
||||
for _, test := range labels {
|
||||
if IsLabel(test.label) != test.isValid {
|
||||
t.Errorf("Label %v is expected to have this validaty : %v - and has the opposite", test.label, test.isValid)
|
||||
if x := IsLabel(test.label); x != test.isValid {
|
||||
t.Errorf("Label %v expected %v, got: %v", test.label, test.isValid, x)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user