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

Commit

Permalink
comment lines keep prefix whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Micklei committed Mar 8, 2018
1 parent 1e8d4d7 commit 12fbf47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ comment 3
}

func TestParseCStyleCommentWithIndent(t *testing.T) {
t.Skip("See https://github.com/emicklei/proto/issues/53")
proto := `
/*comment 1
comment 2
Expand All @@ -146,10 +145,13 @@ func TestParseCStyleCommentWithIndent(t *testing.T) {
if got, want := len(def.Elements[0].(*Comment).Lines), 6; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
if got, want := def.Elements[0].(*Comment).Lines[3], "comment 3"; got != want {
if got, want := def.Elements[0].(*Comment).Lines[0], "comment 1"; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
if got, want := def.Elements[0].(*Comment).Lines[4], " comment 4"; got != want {
if got, want := def.Elements[0].(*Comment).Lines[3], "\tcomment 3"; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
if got, want := def.Elements[0].(*Comment).Lines[4], "\t comment 4"; got != want {
t.Fatalf("got [%v] want [%v]", got, want)
}
if got, want := def.Elements[0].(*Comment).Cstyle, true; got != want {
Expand Down

0 comments on commit 12fbf47

Please sign in to comment.