fmt: fix unnecessary line break in array init (fix #11448) (#11562)

This commit is contained in:
yuyi 2021-09-21 21:20:09 +08:00 committed by GitHub
parent d6fa6a459c
commit 108a01d65f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 532 additions and 518 deletions

View file

@ -28,8 +28,7 @@ fn test_strip_margins_white_space_after_delim() {
fn test_strip_margins_alternate_delim() {
alternate_delimiter := ['This has a different delim,', 'but that is ok',
'because everything works',
].join('\n')
'because everything works'].join('\n')
alternate_delimiter_stripped := 'This has a different delim,
#but that is ok
#because everything works'.strip_margin_custom(`#`)
@ -48,8 +47,7 @@ fn test_strip_margins_multiple_delims_after_first() {
fn test_strip_margins_uneven_delims() {
uneven_delims := ["It doesn't matter if the delims are uneven,",
'The text will still be delimited correctly.', 'Maybe not everything needs 3 lines?',
'Let us go for 4 then',
].join('\n')
'Let us go for 4 then'].join('\n')
uneven_delims_stripped := "It doesn't matter if the delims are uneven,
|The text will still be delimited correctly.
|Maybe not everything needs 3 lines?
@ -59,8 +57,7 @@ fn test_strip_margins_uneven_delims() {
fn test_strip_margins_multiple_blank_lines() {
multi_blank_lines := ['Multiple blank lines will be removed.',
' I actually consider this a feature.',
].join('\n')
' I actually consider this a feature.'].join('\n')
multi_blank_lines_stripped := 'Multiple blank lines will be removed.