.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / github.com / google / go-cmp@v0.5.4 / cmp / internal / value / zero_test.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/github.com/google/go-cmp@v0.5.4/cmp/internal/value/zero_test.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/github.com/google/go-cmp@v0.5.4/cmp/internal/value/zero_test.go
new file mode 100644 (file)
index 0000000..ddaa337
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright 2019, The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package value
+
+import (
+       "archive/tar"
+       "math"
+       "reflect"
+       "testing"
+)
+
+func TestIsZero(t *testing.T) {
+       tests := []struct {
+               in   interface{}
+               want bool
+       }{
+               {0, true},
+               {1, false},
+               {"", true},
+               {"foo", false},
+               {[]byte(nil), true},
+               {[]byte{}, false},
+               {map[string]bool(nil), true},
+               {map[string]bool{}, false},
+               {tar.Header{}, true},
+               {&tar.Header{}, false},
+               {tar.Header{Name: "foo"}, false},
+               {(chan bool)(nil), true},
+               {make(chan bool), false},
+               {(func(*testing.T))(nil), true},
+               {TestIsZero, false},
+               {[...]int{0, 0, 0}, true},
+               {[...]int{0, 1, 0}, false},
+               {math.Copysign(0, +1), true},
+               {math.Copysign(0, -1), false},
+               {complex(math.Copysign(0, +1), math.Copysign(0, +1)), true},
+               {complex(math.Copysign(0, -1), math.Copysign(0, +1)), false},
+               {complex(math.Copysign(0, +1), math.Copysign(0, -1)), false},
+               {complex(math.Copysign(0, -1), math.Copysign(0, -1)), false},
+       }
+
+       for _, tt := range tests {
+               t.Run("", func(t *testing.T) {
+                       got := IsZero(reflect.ValueOf(tt.in))
+                       if got != tt.want {
+                               t.Errorf("IsZero(%v) = %v, want %v", tt.in, got, tt.want)
+                       }
+               })
+       }
+}