Clean up and document validation strings

Also add a detail string for Required and Forbidden.  Fix tests.
This commit is contained in:
Tim Hockin
2015-11-14 12:26:04 -08:00
parent 27fc14000d
commit 43ed74748e
10 changed files with 236 additions and 199 deletions

View File

@@ -105,17 +105,17 @@ func TestValidateLogFlags(t *testing.T) {
{
name: "since & since-time",
flags: map[string]string{"since": "1h", "since-time": "2006-01-02T15:04:05Z"},
expected: "only one of sinceTime or sinceSeconds can be provided",
expected: "at most one of `sinceTime` or `sinceSeconds` may be specified",
},
{
name: "negative limit-bytes",
flags: map[string]string{"limit-bytes": "-100"},
expected: "limitBytes must be a positive integer or nil",
expected: "must be greater than 0",
},
{
name: "negative tail",
flags: map[string]string{"tail": "-100"},
expected: "tailLines must be a non-negative integer or nil",
expected: "must be greater than or equal to 0",
},
}
for _, test := range tests {