added support for string type
[govpp.git] / vendor / github.com / onsi / gomega / matchers / be_zero_matcher_test.go
1 package matchers_test
2
3 import (
4         . "github.com/onsi/ginkgo"
5         . "github.com/onsi/gomega"
6 )
7
8 var _ = Describe("BeZero", func() {
9         It("should succeed if the passed in object is the zero value for its type", func() {
10                 Ω(nil).Should(BeZero())
11
12                 Ω("").Should(BeZero())
13                 Ω(" ").ShouldNot(BeZero())
14
15                 Ω(0).Should(BeZero())
16                 Ω(1).ShouldNot(BeZero())
17
18                 Ω(0.0).Should(BeZero())
19                 Ω(0.1).ShouldNot(BeZero())
20
21                 // Ω([]int{}).Should(BeZero())
22                 Ω([]int{1}).ShouldNot(BeZero())
23
24                 // Ω(map[string]int{}).Should(BeZero())
25                 Ω(map[string]int{"a": 1}).ShouldNot(BeZero())
26
27                 Ω(myCustomType{}).Should(BeZero())
28                 Ω(myCustomType{s: "a"}).ShouldNot(BeZero())
29         })
30 })