Skip to content

Instantly share code, notes, and snippets.

@aarzilli
Created January 10, 2016 10:40
Show Gist options
  • Save aarzilli/ef9f946b0262dd509078 to your computer and use it in GitHub Desktop.
Save aarzilli/ef9f946b0262dd509078 to your computer and use it in GitHub Desktop.
% dlv test
Type 'help' for list of commands.
(dlv) b vlq_test.go:8
b vlq_test.go:8
Breakpoint 1 set at 0x47e740 for _/home/a/temp/vlq.TestVarInt ./vlq_test.go:8
(dlv) c
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):1 total:1)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv) n
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):2 total:2)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):3 total:3)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):4 total:4)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):5 total:5)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):6 total:6)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):7 total:7)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):8 total:8)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):9 total:9)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):10 total:10)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):11 total:11)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):12 total:12)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):13 total:13)
3: import (
4: "bytes"
5: "testing"
6: )
7:
=> 8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:23
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
=> 23: {0x00FFFFFFFFFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}}, // maximum write value
24: }
25:
26: for _, tt := range tests {
27: dst, err := writeVarInt(nil, tt.value)
28: if err != nil {
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:13
8: func TestVarInt(t *testing.T) {
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
=> 13: {0x00000000, []byte{0x00}},
14: {0x0000007F, []byte{0x7F}},
15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:14
9: tests := []struct {
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
=> 14: {0x0000007F, []byte{0x7F}},
15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:15
10: value uint64
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
14: {0x0000007F, []byte{0x7F}},
=> 15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:16
11: encoded []byte
12: }{
13: {0x00000000, []byte{0x00}},
14: {0x0000007F, []byte{0x7F}},
15: {0x00000080, []byte{0x81, 0x00}},
=> 16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:17
12: }{
13: {0x00000000, []byte{0x00}},
14: {0x0000007F, []byte{0x7F}},
15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
=> 17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:18
13: {0x00000000, []byte{0x00}},
14: {0x0000007F, []byte{0x7F}},
15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
=> 18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
23: {0x00FFFFFFFFFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}}, // maximum write value
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:19
14: {0x0000007F, []byte{0x7F}},
15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
=> 19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
23: {0x00FFFFFFFFFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}}, // maximum write value
24: }
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:20
15: {0x00000080, []byte{0x81, 0x00}},
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
=> 20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
23: {0x00FFFFFFFFFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}}, // maximum write value
24: }
25:
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:21
16: {0x00002000, []byte{0xC0, 0x00}},
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
=> 21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
23: {0x00FFFFFFFFFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}}, // maximum write value
24: }
25:
26: for _, tt := range tests {
(dlv)
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:22
17: {0x00003FFF, []byte{0xFF, 0x7F}},
18: {0x00004000, []byte{0x81, 0x80, 0x00}},
19: {0x001FFFFF, []byte{0xFF, 0xFF, 0x7F}},
20: {0x00200000, []byte{0x81, 0x80, 0x80, 0x00}},
21: {0x08000000, []byte{0xC0, 0x80, 0x80, 0x00}},
=> 22: {0x0FFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0x7F}},
23: {0x00FFFFFFFFFFFFFF, []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}}, // maximum write value
24: }
25:
26: for _, tt := range tests {
27: dst, err := writeVarInt(nil, tt.value)
(dlv) c
c
PASS
Process 28066 has exited with status 0
(dlv) q
q
Process 28066 has exited with status 0
%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment