MCPcopy
hub / github.com/rs/xid / TestFromString

Function TestFromString

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

Source from the content-addressed store, hash-verified

133}
134
135func TestFromString(t *testing.T) {
136 got, err := FromString("9m4e2mr0ui3e8a215n4g")
137 if err != nil {
138 t.Fatal(err)
139 }
140 want := ID{0x4d, 0x88, 0xe1, 0x5b, 0x60, 0xf4, 0x86, 0xe4, 0x28, 0x41, 0x2d, 0xc9}
141 if got != want {
142 t.Errorf("FromString() = %v, want %v", got, want)
143 }
144}
145
146func TestFromStringInvalid(t *testing.T) {
147 _, err := FromString("invalid")

Callers

nothing calls this directly

Calls 1

FromStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…