Skip to content

Commit

Permalink
Add failing test cases for golang issue 5128.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitshur committed Feb 2, 2015
1 parent 309be19 commit bfc69a3
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 101/printer/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func diff(aname, bname string, a, b []byte) error {
for i := 0; i < len(a) && i < len(b); i++ {
ch := a[i]
if ch != b[i] {
fmt.Fprintf(&buf, "\n%s:%d:%d: %s", aname, line, i-offs+1, lineAt(a, offs))
fmt.Fprintf(&buf, "\n%s:%d:%d: %s", bname, line, i-offs+1, lineAt(b, offs))
fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs))
fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs))
fmt.Fprintf(&buf, "\n\n")
break
}
Expand Down
62 changes: 62 additions & 0 deletions 101/printer/testdata/comments.golden
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,68 @@ func _() {
aligned line */
}

// Test cases from issue 5128?
func _() {
/*a string

b string*/

/*A string



Z string*/

/*a string

b string

c string*/

{
/*a string
b string*/

/*a string

b string*/

/*a string

b string

c string*/
}

{
/*a string
b string*/

/*a string

b string*/

/*a string

b string

c string*/
}

/*
*/

/*

*/

/*

* line

*/
}

/*
* line
* of
Expand Down
62 changes: 62 additions & 0 deletions 101/printer/testdata/comments.input
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,68 @@ func _() {
aligned line */
}

// Test cases from issue 5128?
func _() {
/*a string

b string*/

/*A string



Z string*/

/*a string

b string

c string*/

{
/*a string
b string*/

/*a string

b string*/

/*a string

b string

c string*/
}

{
/*a string
b string*/

/*a string

b string*/

/*a string

b string

c string*/
}

/*
*/

/*

*/

/*

* line

*/
}

/*
* line
* of
Expand Down

0 comments on commit bfc69a3

Please sign in to comment.