MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / TestBuilderTEA

Function TestBuilderTEA

utils/binary/builder_test.go:57–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestBuilderTEA(t *testing.T) {
58 k := make([]byte, 16)
59 _, err := rand.Read(k)
60 if err != nil {
61 t.Fatal(err)
62 }
63 b := NewBuilder(k...)
64 b.p(func(ub *pbuf.UserBuffer[teacfg]) {
65 dat := ub.DAT.key.ToBytes()
66 if !bytes.Equal(dat[:], k) {
67 t.Fatal("exp", hex.EncodeToString(k), "got", hex.EncodeToString(dat[:]))
68 }
69 })
70}
71
72// from https://github.com/Mrs4s/MiraiGo/blob/master/binary/writer_test.go
73

Callers

nothing calls this directly

Calls 3

pMethod · 0.95
NewBuilderFunction · 0.85
ToBytesMethod · 0.80

Tested by

no test coverage detected