aboutsummaryrefslogtreecommitdiff
path: root/tests/legacy/examples/proto/gogo/gogo_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/legacy/examples/proto/gogo/gogo_test.go')
-rw-r--r--tests/legacy/examples/proto/gogo/gogo_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/legacy/examples/proto/gogo/gogo_test.go b/tests/legacy/examples/proto/gogo/gogo_test.go
new file mode 100644
index 00000000..b6fb3eec
--- /dev/null
+++ b/tests/legacy/examples/proto/gogo/gogo_test.go
@@ -0,0 +1,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)
+ }
+}