aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Brandenburger <[email protected]>2015-01-16 11:24:28 -0800
committerFilipe Brandenburger <[email protected]>2015-01-16 11:24:28 -0800
commit99bcedf5411e47380739c8999a6ae3fdd0739fa3 (patch)
treeb3f8388f0b6d1ea1023205fa391beb3b1606a635
parent463bdc838f2b35e9307e91d480878bda5fff7232 (diff)
Fix unit tests to include Type() method in custom types
This was broken by commit 463bdc838f2b35 ("Adding Type() method to the values.") which added the method to the interface but did not update the custom types in unit tests. Signed-off-by: Filipe Brandenburger <[email protected]>
-rw-r--r--example_test.go4
-rw-r--r--flag_test.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/example_test.go b/example_test.go
index 03ebeaa..6aaed3c 100644
--- a/example_test.go
+++ b/example_test.go
@@ -29,6 +29,10 @@ func (i *interval) String() string {
return fmt.Sprint(*i)
}
+func (i *interval) Type() string {
+ return "interval"
+}
+
// Set is the method to set the flag value, part of the flag.Value interface.
// Set's argument is a string to be parsed to set the flag.
// It's a comma-separated list, so we split it.
diff --git a/flag_test.go b/flag_test.go
index 4d95b15..47865bd 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -245,6 +245,10 @@ func (f *flagVar) Set(value string) error {
return nil
}
+func (f *flagVar) Type() string {
+ return "flagVar"
+}
+
func TestUserDefined(t *testing.T) {
var flags FlagSet
flags.Init("test", ContinueOnError)