MCPcopy Create free account
hub / github.com/rilldata/rill / TestPrefix

Function TestPrefix

admin/pkg/authtoken/authtoken_test.go:103–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func TestPrefix(t *testing.T) {
104 tkn := NewRandom(TypeUser)
105 require.Equal(t, TypeUser, tkn.Type)
106 require.True(t, strings.HasPrefix(tkn.String(), tkn.Prefix()), "Full token should start with prefix")
107 require.NotEqual(t, tkn.Prefix(), tkn.String(), "Prefix should not match the full token string")
108}
109
110func TestMatchByPrefix(t *testing.T) {
111 t1 := NewRandom(TypeUser)

Callers

nothing calls this directly

Calls 3

PrefixMethod · 0.80
NewRandomFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected