aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go')
-rw-r--r--vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go b/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go
new file mode 100644
index 0000000..8ec3643
--- /dev/null
+++ b/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go
@@ -0,0 +1,30 @@
+package matchers_test
+
+import (
+ . "github.com/onsi/ginkgo"
+ . "github.com/onsi/gomega"
+)
+
+var _ = Describe("BeZero", func() {
+ It("should succeed if the passed in object is the zero value for its type", func() {
+ Ω(nil).Should(BeZero())
+
+ Ω("").Should(BeZero())
+ Ω(" ").ShouldNot(BeZero())
+
+ Ω(0).Should(BeZero())
+ Ω(1).ShouldNot(BeZero())
+
+ Ω(0.0).Should(BeZero())
+ Ω(0.1).ShouldNot(BeZero())
+
+ // Ω([]int{}).Should(BeZero())
+ Ω([]int{1}).ShouldNot(BeZero())
+
+ // Ω(map[string]int{}).Should(BeZero())
+ Ω(map[string]int{"a": 1}).ShouldNot(BeZero())
+
+ Ω(myCustomType{}).Should(BeZero())
+ Ω(myCustomType{s: "a"}).ShouldNot(BeZero())
+ })
+})