Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Add tests for comments in rpc options brackets (emicklei#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev authored and emicklei committed Mar 13, 2018
1 parent c9836c3 commit 7abc7dc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,29 @@ func TestServiceWithOption(t *testing.T) {
t.Errorf("got [%v] want [%v]", got, want)
}
}

func TestRPCWithOneLineCommentInOptionBlock(t *testing.T) {
proto := `service AccountService {
rpc CreateAccount (CreateAccount) returns (ServiceFault) {
// test comment
}
}`
_, err := newParserOn(proto).Parse()
if err != nil {
t.Fatal(err)
}
}

func TestRPCWithMultiLineCommentInOptionBlock(t *testing.T) {
t.Skip("this fails")
proto := `service AccountService {
rpc CreateAccount (CreateAccount) returns (ServiceFault) {
// test comment
// test comment
}
}`
_, err := newParserOn(proto).Parse()
if err != nil {
t.Fatal(err)
}
}

0 comments on commit 7abc7dc

Please sign in to comment.