From b40ca794fe33a28f1ca4d6aedacc76b706ea8b04 Mon Sep 17 00:00:00 2001 From: vince Date: Wed, 26 Aug 2020 11:06:34 +0800 Subject: Add tests --- plumbing/format/config/option_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'plumbing/format/config/option_test.go') 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"}, -- cgit