Method to sort keys in map.

This commit is contained in:
Andrey Smirnov
2014-01-21 13:36:09 +04:00
parent e183ddb981
commit e21506d373
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -42,3 +42,8 @@ func (s *ListSuite) TestStrSliceHasIteml(c *C) {
c.Check(StrSliceHasItem([]string{"a", "b"}, "b"), Equals, true)
c.Check(StrSliceHasItem([]string{"a", "b"}, "c"), Equals, false)
}
func (s *ListSuite) TestStrMapSortedKeys(c *C) {
c.Check(StrMapSortedKeys(map[string]string{}), DeepEquals, []string{})
c.Check(StrMapSortedKeys(map[string]string{"x": "1", "a": "3", "y": "4"}), DeepEquals, []string{"a", "x", "y"})
}