aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/config/option_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/config/option_test.go')
-rw-r--r--plumbing/format/config/option_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/plumbing/format/config/option_test.go b/plumbing/format/config/option_test.go
index 8588de1..49b4855 100644
--- a/plumbing/format/config/option_test.go
+++ b/plumbing/format/config/option_test.go
@@ -8,6 +8,21 @@ type OptionSuite struct{}
var _ = Suite(&OptionSuite{})
+func (s *OptionSuite) TestOptions_Has(c *C) {
+ o := Options{
+ &Option{"k", "v"},
+ &Option{"ok", "v1"},
+ &Option{"K", "v2"},
+ }
+ c.Assert(o.Has("k"), Equals, true)
+ c.Assert(o.Has("K"), Equals, true)
+ c.Assert(o.Has("ok"), Equals, true)
+ c.Assert(o.Has("unexistant"), Equals, false)
+
+ o = Options{}
+ c.Assert(o.Has("k"), Equals, false)
+}
+
func (s *OptionSuite) TestOptions_GetAll(c *C) {
o := Options{
&Option{"k", "v"},