blob: c33b316a9e4d9366800bf6ebd947ac7cace4e1d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package serializer
import (
"bytes"
"testing"
)
func TestSerializer(t *testing.T) {
x := &X{
Y: Y{1},
P: &Y{2},
A: []Y{{3}, {4}},
B: true,
S: "a\x09b",
T: T1,
F: nil,
}
buf := new(bytes.Buffer)
Write(buf, x)
t.Logf("\n%s", buf.String())
t.Logf("\n%#v", x)
}
type X struct {
Y Y
P *Y
A []Y
B bool
S string
T T
F func()
}
type Y struct {
V int
}
type T int
const (
_ T = iota
T1
)
|