MCPcopy
hub / github.com/cubefs/cubefs / TestDefaulterBasicNotType

Function TestDefaulterBasicNotType

blobstore/util/defaulter/defaulter_test.go:59–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestDefaulterBasicNotType(t *testing.T) {
60 require.Panics(t, func() {
61 val := int(0)
62 defaulter.Equal(val, 10)
63 })
64 require.Panics(t, func() {
65 val := int(0)
66 defaulter.Equal(&val, int64(10))
67 })
68 require.Panics(t, func() {
69 val := ""
70 defaulter.Equal(&val, "def")
71 })
72 require.Panics(t, func() {
73 type none struct{}
74 defaulter.Less(&none{}, none{})
75 })
76 require.Panics(t, func() {
77 type none struct{}
78 defaulter.LessOrEqual(&none{}, none{})
79 })
80}
81
82func TestDefaulterBasicEqual(t *testing.T) {
83 for idx, cs := range []struct {

Callers

nothing calls this directly

Calls 3

EqualFunction · 0.92
LessFunction · 0.92
LessOrEqualFunction · 0.92

Tested by

no test coverage detected