add parsers tests

Signed-off-by: Martin <martin.piegay@zenika.com>
This commit is contained in:
Martin 2016-05-27 11:13:34 +02:00
parent c5084fd025
commit 4776fa1361
3 changed files with 68 additions and 9 deletions

View file

@ -49,8 +49,7 @@ type DefaultEntryPoints []string
// String is the method to format the flag's value, part of the flag.Value interface.
// The String method's output will be used in diagnostics.
func (dep *DefaultEntryPoints) String() string {
//TODO : The string returned should be formatted in such way that the func Set below could parse it.
return fmt.Sprintf("%#v", dep)
return strings.Join(*dep, ",")
}
// Set is the method to set the flag value, part of the flag.Value interface.
@ -86,9 +85,6 @@ type EntryPoints map[string]*EntryPoint
// String is the method to format the flag's value, part of the flag.Value interface.
// The String method's output will be used in diagnostics.
func (ep *EntryPoints) String() string {
//TODO : The string returned should be formatted in such way that the func Set below could parse it.
//Like this --entryPoints='Name:http Address::8000 Redirect.EntryPoint:https'
//But the Set func parses entrypoint one by one only
return fmt.Sprintf("%+v", *ep)
}
@ -176,7 +172,6 @@ type Certificates []Certificate
// The String method's output will be used in diagnostics.
func (certs *Certificates) String() string {
if len(*certs) == 0 {
//TODO :
return ""
}
return (*certs)[0].CertFile + "," + (*certs)[0].KeyFile