diff options
author | vince <vincetiu8@gmail.com> | 2020-08-26 11:06:34 +0800 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-08-27 13:53:54 +0200 |
commit | b40ca794fe33a28f1ca4d6aedacc76b706ea8b04 (patch) | |
tree | aedcc77cbc552436d52df386ee38d162bbe52e0a /plumbing/format/config/option_test.go | |
parent | 576e1c63c4d08fca04cf060392a8c3d8b0bba89a (diff) | |
download | go-git-b40ca794fe33a28f1ca4d6aedacc76b706ea8b04.tar.gz |
Add tests
Diffstat (limited to 'plumbing/format/config/option_test.go')
-rw-r--r-- | plumbing/format/config/option_test.go | 15 |
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"}, |