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

Commit

Permalink
Add skipped test for one-line c-style comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Jan 4, 2018
1 parent e600e2a commit fdeb2dd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,29 @@ func TestParseCStyleCommentWithIndent(t *testing.T) {
}
}

func TestParseCStyleOneLineComment(t *testing.T) {
t.Skip("See https://github.com/emicklei/proto/issues/54")
proto := `/* comment 1 */`
p := newParserOn(proto)
def, err := p.Parse()
if err != nil {
t.Fatal(err)
}
if got, want := len(def.Elements), 1; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}

if got, want := len(def.Elements[0].(*Comment).Lines), 1; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
if got, want := def.Elements[0].(*Comment).Lines[0], "/* comment 1 */"; got != want {
t.Errorf("got [%v] want [%v]", got, want)
}
if got, want := def.Elements[0].(*Comment).Cstyle, true; got != want {
t.Errorf("got [%v] want [%v]", got, want)
}
}

func TestParseCommentWithTripleSlash(t *testing.T) {
proto := `
/// comment 1
Expand Down

0 comments on commit fdeb2dd

Please sign in to comment.