MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestProgramBuilder_PushBytes

Function TestProgramBuilder_PushBytes

core/program/program_test.go:30–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestProgramBuilder_PushBytes(t *testing.T) {
31 N := 20000
32 builder := NewProgramBuilder()
33 for i := 0; i < N; i++ {
34 builder.PushNum(uint16(i))
35 }
36 parser := newProgramParser(builder.Finish())
37 for i := 0; i < N; i++ {
38 n, err := parser.ReadNum()
39 assert.Nil(t, err)
40 assert.Equal(t, n, uint16(i))
41 }
42}
43
44func TestGetProgramInfo(t *testing.T) {
45 N := 10

Callers

nothing calls this directly

Calls 5

PushNumMethod · 0.95
FinishMethod · 0.95
NewProgramBuilderFunction · 0.85
newProgramParserFunction · 0.85
ReadNumMethod · 0.80

Tested by

no test coverage detected