MCPcopy Create free account
hub / github.com/rs/xid / TestIDDriverScanByteFromDatabase

Function TestIDDriverScanByteFromDatabase

id_test.go:206–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func TestIDDriverScanByteFromDatabase(t *testing.T) {
207 got := ID{}
208 bs := []byte("9m4e2mr0ui3e8a215n4g")
209 err := got.Scan(bs)
210 if err != nil {
211 t.Fatal(err)
212 }
213 want := ID{0x4d, 0x88, 0xe1, 0x5b, 0x60, 0xf4, 0x86, 0xe4, 0x28, 0x41, 0x2d, 0xc9}
214 if got.Compare(want) != 0 {
215 t.Errorf("Scan() = %v, want %v", got, want)
216 }
217}
218
219func BenchmarkNew(b *testing.B) {
220 b.RunParallel(func(pb *testing.PB) {

Callers

nothing calls this directly

Calls 2

ScanMethod · 0.95
CompareMethod · 0.95

Tested by

no test coverage detected