MCPcopy
hub / github.com/perkeep/perkeep / TestEquality

Function TestEquality

pkg/blob/ref_test.go:98–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96}
97
98func TestEquality(t *testing.T) {
99 in := "sha1-0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
100 in3 := "sha1-ffffffffffffffffffffffffffffffffffffffff"
101 r := ParseOrZero(in)
102 r2 := ParseOrZero(in)
103 r3 := ParseOrZero(in3)
104 if !r.Valid() || !r2.Valid() || !r3.Valid() {
105 t.Fatal("not valid")
106 }
107 if r != r2 {
108 t.Errorf("r and r2 should be equal")
109 }
110 if r == r3 {
111 t.Errorf("r and r3 should not be equal")
112 }
113}
114
115func TestSum32(t *testing.T) {
116 got := MustParse("sha1-1234567800000000000000000000000000000000").Sum32()

Callers

nothing calls this directly

Calls 3

ParseOrZeroFunction · 0.85
FatalMethod · 0.80
ValidMethod · 0.45

Tested by

no test coverage detected