MCPcopy
hub / github.com/grafana/dskit / TestTokens_Serialization

Function TestTokens_Serialization

ring/tokens_test.go:12–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestTokens_Serialization(t *testing.T) {
13 tokens := make(Tokens, 512)
14 for i := 0; i < 512; i++ {
15 tokens = append(tokens, uint32(rand.Int31()))
16 }
17
18 b, err := tokens.Marshal()
19 require.NoError(t, err)
20
21 var unmarshaledTokens Tokens
22 require.NoError(t, unmarshaledTokens.Unmarshal(b))
23 require.Equal(t, tokens, unmarshaledTokens)
24}
25
26func TestTokens_Equals(t *testing.T) {
27 tests := []struct {

Callers

nothing calls this directly

Calls 3

UnmarshalMethod · 0.95
MarshalMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected