Skip to content

Commit

Permalink
add test for issue #50
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Micklei committed Jan 4, 2018
1 parent 8512541 commit 767573a
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

package proto

import "testing"
import (
"testing"
)

func TestOptionCases(t *testing.T) {
for i, each := range []struct {
Expand Down Expand Up @@ -213,3 +215,24 @@ option Help = { string_field: "value" }; // inline`
t.Fatalf("got [%v] want [%v]", got, want)
}
}

func TestNestedAggregatedOption(t *testing.T) {
t.Skip("https://github.com/emicklei/proto/issues/50")
src := `
option (foo.bar) = {
woot: 100
foo: {
hello: 200
}
};
`
p := newParserOn(src)
pr, err := p.Parse()
if err != nil {
t.Fatal(err)
}
o := pr.Elements[0].(*Option)
if got, want := len(o.AggregatedConstants), 2; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
}

0 comments on commit 767573a

Please sign in to comment.