| Index: mojom/generators/go/templates/test_utils.go
|
| diff --git a/mojom/generators/go/templates/declarations_test.go b/mojom/generators/go/templates/test_utils.go
|
| similarity index 72%
|
| rename from mojom/generators/go/templates/declarations_test.go
|
| rename to mojom/generators/go/templates/test_utils.go
|
| index 5b4b3329a6096069dcb38968d0a8a7cfd9463828..e0d87d1ae7f935868238176d3ad5e701ace18f1f 100644
|
| --- a/mojom/generators/go/templates/declarations_test.go
|
| +++ b/mojom/generators/go/templates/test_utils.go
|
| @@ -11,7 +11,6 @@ import (
|
| "testing"
|
|
|
| "mojom/generators/go/gofmt"
|
| - "mojom/generators/go/translator"
|
| )
|
|
|
| func check(t *testing.T, expected string, template string, input interface{}) {
|
| @@ -20,6 +19,11 @@ func check(t *testing.T, expected string, template string, input interface{}) {
|
| panic(err)
|
| }
|
|
|
| + expected, err := gofmt.FormatFragment(expected)
|
| + if err != nil {
|
| + panic(err)
|
| + }
|
| +
|
| src := buffer.String()
|
| actual, err := gofmt.FormatFragment(src)
|
| if err != nil {
|
| @@ -34,20 +38,3 @@ func check(t *testing.T, expected string, template string, input interface{}) {
|
| t.Fatalf(errorMsg)
|
| }
|
| }
|
| -
|
| -func TestStructDecl(t *testing.T) {
|
| - expected := `type Foo struct {
|
| - Alpha string
|
| - Beta uint32
|
| -}`
|
| -
|
| - s := translator.StructTemplate{
|
| - Name: "Foo",
|
| - Fields: []translator.StructFieldTemplate{
|
| - {Name: "Alpha", Type: "string"},
|
| - {Name: "Beta", Type: "uint32"},
|
| - },
|
| - }
|
| -
|
| - check(t, expected, "StructDecl", s)
|
| -}
|
|
|