Skip to content

Commit cd1b72b

Browse files
committed
Add some more golden test cases
1 parent bb88c16 commit cd1b72b

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

hashstructure_test.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ func TestHash_equalIgnore(t *testing.T) {
268268
},
269269
true,
270270
},
271+
{
272+
int16(-32768), uint16(32768), true,
273+
},
271274
}
272275

273276
for _, tc := range cases {
@@ -721,6 +724,14 @@ func TestHash_golden(t *testing.T) {
721724
In: int16(42),
722725
Expect: 590708257076254031,
723726
},
727+
{
728+
In: int16(-32768),
729+
Expect: 590684067820433261,
730+
},
731+
{
732+
In: int16(32767),
733+
Expect: 590474061099445023,
734+
},
724735
{
725736
In: int32(42),
726737
Expect: 843871326190827175,
@@ -729,11 +740,18 @@ func TestHash_golden(t *testing.T) {
729740
In: int64(42),
730741
Expect: 11375694726533372055,
731742
},
732-
743+
{
744+
In: uint16(0),
745+
Expect: 590684067820433389,
746+
},
733747
{
734748
In: uint16(42),
735749
Expect: 590708257076254031,
736750
},
751+
{
752+
In: uint16(65535),
753+
Expect: 590474061099445151,
754+
},
737755
{
738756
In: uint32(42),
739757
Expect: 843871326190827175,
@@ -750,10 +768,18 @@ func TestHash_golden(t *testing.T) {
750768
In: float64(42),
751769
Expect: 12162027084228238918,
752770
},
771+
{
772+
In: float64(3.14159265359),
773+
Expect: 999115755352816086,
774+
},
753775
{
754776
In: complex64(42),
755777
Expect: 13187391128804187615,
756778
},
779+
{
780+
In: complex64(complex(1.2, 3.4)),
781+
Expect: 12862333766589160118,
782+
},
757783
{
758784
In: complex128(42),
759785
Expect: 4635205179288363782,

0 commit comments

Comments
 (0)