fmt: array newlines test
parent
85c5103ba3
commit
de9f302412
|
@ -482,11 +482,11 @@ fn (var f Fmt) expr(node ast.Expr) {
|
|||
f.wrap_long_line()
|
||||
}
|
||||
f.expr(expr)
|
||||
if i < it.exprs.len - 1 {
|
||||
f.write(', ')
|
||||
}
|
||||
if line_nr < pos.line_nr {
|
||||
// Previous element was on a different line, add a newline
|
||||
f.writeln('')
|
||||
} else if i < it.exprs.len - 1 {
|
||||
f.write(', ')
|
||||
}
|
||||
line_nr = pos.line_nr
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
fn make_flag(a, b, c string) string {
|
||||
return ''
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// Set up flags
|
||||
expected_flags := [
|
||||
make_flag('solaris', '-L', '/opt/local/lib')
|
||||
make_flag('darwin', '-framework', 'Cocoa')
|
||||
make_flag('windows', '-l', 'gdi32')
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue