aboutsummaryrefslogtreecommitdiffstats
path: root/clients/common/common_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-11-17 07:50:32 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2015-11-17 07:50:32 +0100
commit491de646e625801d2f809ed4a99c7ace019a3f15 (patch)
tree8a5ff1e0425a1da8ca8fd4875ba20227961d228b /clients/common/common_test.go
parent49f40d9f410a6fc0a9c89ba228d16cd570ec711a (diff)
downloadgo-git-491de646e625801d2f809ed4a99c7ace019a3f15.tar.gz
client/common: fix empty panic on set at empty capability
Diffstat (limited to 'clients/common/common_test.go')
-rw-r--r--clients/common/common_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/clients/common/common_test.go b/clients/common/common_test.go
index dac15b6..c8dafe9 100644
--- a/clients/common/common_test.go
+++ b/clients/common/common_test.go
@@ -82,6 +82,13 @@ func (s *SuiteCommon) TestCapabilitiesSet(c *C) {
c.Assert(cap.Get("symref").Values, DeepEquals, []string{"bar"})
}
+func (s *SuiteCommon) TestCapabilitiesSetEmpty(c *C) {
+ cap := NewCapabilities()
+ cap.Set("foo", "bar")
+
+ c.Assert(cap.Get("foo").Values, HasLen, 1)
+}
+
func (s *SuiteCommon) TestCapabilitiesAdd(c *C) {
cap := NewCapabilities()
cap.Add("symref", "foo", "qux")