aboutsummaryrefslogtreecommitdiff
path: root/tests/legacy/examples/proto/gogo/gogo_test.go
blob: b6fb3eec9690bee10eb9fdfb79a3a2ad20a71a0a (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
package gogo_test

import (
	"testing"

	"github.com/bazelbuild/rules_go/examples/proto/gogo"
)

func TestGoString(t *testing.T) {
	p := gogo.Value{Item: 20}
	got := p.GoString()
	expect := "&gogo.Value{Item: 20,\n}"
	if got != expect {
		t.Errorf("got %q, expect %q", got, expect)
	}
}

func TestSize(t *testing.T) {
	p := gogo.Value{Item: 20}
	got := p.Size()
	expect := 2
	if got != expect {
		t.Errorf("got %v, expect %v", got, expect)
	}
}