MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / TestEquals

Function TestEquals

engine/generic_value_test.go:113–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestEquals(t *testing.T) {
114 oneInt := IntegerValue{
115 Value: 1,
116 }
117 twoInt := IntegerValue{
118 Value: 2,
119 }
120 oneString := StringValue{
121 Value: "one",
122 }
123 twoString := StringValue{
124 Value: "two",
125 }
126 oneNull := NullValue{}
127 twoNull := NullValue{}
128
129 shouldBeEqual(t, oneInt, oneInt)
130 shouldBeEqual(t, oneString, oneString)
131 shouldBeEqual(t, oneNull, twoNull)
132 shouldNotBeEqual(t, oneInt, twoInt)
133 shouldNotBeEqual(t, oneString, twoString)
134 shouldNotBeEqual(t, oneString, oneInt)
135 shouldNotBeEqual(t, oneNull, oneInt)
136 shouldNotBeEqual(t, oneNull, oneString)
137 shouldNotBeEqual(t, twoInt, twoNull)
138}
139
140func shouldBeEqual(t *testing.T, valueOne ValueInterface, valueTwo ValueInterface) {
141 const ErrorMsgShouldBeEqual = "%s(type: %v) is not equal %s(type: %v), but is should be"

Callers

nothing calls this directly

Calls 2

shouldBeEqualFunction · 0.85
shouldNotBeEqualFunction · 0.85

Tested by

no test coverage detected