mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-10-16 23:46:26 +00:00
44 lines
830 B
Go
44 lines
830 B
Go
|
package compiler
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/nspcc-dev/neo-go/pkg/internal/testserdes"
|
||
|
)
|
||
|
|
||
|
func TestDebugInfo_MarshalJSON(t *testing.T) {
|
||
|
d := &DebugInfo{
|
||
|
EntryPoint: "main",
|
||
|
Documents: []string{"/path/to/file"},
|
||
|
Methods: []MethodDebugInfo{
|
||
|
{
|
||
|
ID: "id1",
|
||
|
Name: DebugMethodName{
|
||
|
Namespace: "default",
|
||
|
Name: "method1",
|
||
|
},
|
||
|
Range: DebugRange{Start: 10, End: 20},
|
||
|
Parameters: []DebugParam{
|
||
|
{"param1", "Integer"},
|
||
|
{"ok", "Boolean"},
|
||
|
},
|
||
|
ReturnType: "ByteArray",
|
||
|
Variables: []string{},
|
||
|
SeqPoints: []DebugSeqPoint{
|
||
|
{
|
||
|
Opcode: 123,
|
||
|
Document: 1,
|
||
|
StartLine: 2,
|
||
|
StartCol: 3,
|
||
|
EndLine: 4,
|
||
|
EndCol: 5,
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
Events: []EventDebugInfo{},
|
||
|
}
|
||
|
|
||
|
testserdes.MarshalUnmarshalJSON(t, d, new(DebugInfo))
|
||
|
}
|