forked from ruby-formatter/rufo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ruby-formatter#11 from ruby-formatter/dma/new-tests
format(Tests): introduce new test format
- Loading branch information
Showing
108 changed files
with
8,593 additions
and
1,084 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#~# ORIGINAL | ||
|
||
foo &. bar | ||
|
||
#~# EXPECTED | ||
|
||
foo &. bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#~# ORIGINAL | ||
|
||
foo&. bar | ||
|
||
#~# EXPECTED | ||
|
||
foo&. bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#~# ORIGINAL | ||
|
||
foo&. bar = 1 | ||
|
||
#~# EXPECTED | ||
|
||
foo&. bar = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#~# ORIGINAL | ||
|
||
foo&.bar 1 do | ||
end | ||
|
||
#~# EXPECTED | ||
|
||
foo&.bar 1 do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#~# ORIGINAL | ||
|
||
[ | ||
[<<~'},'] # comment | ||
}, | ||
] | ||
|
||
#~# EXPECTED | ||
|
||
[ | ||
[<<~'},'], # comment | ||
}, | ||
] | ||
|
||
#~# ORIGINAL | ||
|
||
[ | ||
[<<~'},'], # comment | ||
}, | ||
] | ||
|
||
#~# EXPECTED | ||
|
||
[ | ||
[<<~'},'], # comment | ||
}, | ||
] | ||
|
||
#~# ORIGINAL | ||
|
||
[ | ||
[<<~'},'], # comment | ||
}, | ||
2, | ||
] | ||
|
||
#~# EXPECTED | ||
|
||
[ | ||
[<<~'},'], # comment | ||
}, | ||
2, | ||
] | ||
|
||
#~# ORIGINAL | ||
|
||
[ | ||
[<<~EOF] # comment | ||
EOF | ||
] | ||
|
||
#~# EXPECTED | ||
|
||
[ | ||
[<<~EOF], # comment | ||
EOF | ||
] | ||
|
||
#~# ORIGINAL | ||
|
||
begin | ||
foo = <<~STR | ||
some | ||
thing | ||
STR | ||
end | ||
|
||
#~# EXPECTED | ||
|
||
begin | ||
foo = <<~STR | ||
some | ||
thing | ||
STR | ||
end | ||
|
||
#~# ORIGINAL | ||
|
||
<<~EOF | ||
foo | ||
bar | ||
EOF | ||
|
||
#~# EXPECTED | ||
|
||
<<~EOF | ||
foo | ||
bar | ||
EOF | ||
|
||
#~# ORIGINAL | ||
|
||
<<~EOF | ||
#{1} | ||
bar | ||
EOF | ||
|
||
#~# EXPECTED | ||
|
||
<<~EOF | ||
#{1} | ||
bar | ||
EOF | ||
|
||
#~# ORIGINAL | ||
|
||
begin | ||
<<~EOF | ||
foo | ||
bar | ||
EOF | ||
end | ||
|
||
#~# EXPECTED | ||
|
||
begin | ||
<<~EOF | ||
foo | ||
bar | ||
EOF | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#~# ORIGINAL | ||
|
||
BEGIN { | ||
1 | ||
2 | ||
} | ||
|
||
#~# EXPECTED | ||
|
||
BEGIN { | ||
1 | ||
2 | ||
} | ||
|
||
#~# ORIGINAL | ||
|
||
BEGIN { 1 ; 2 } | ||
|
||
#~# EXPECTED | ||
|
||
BEGIN { 1; 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#~# ORIGINAL | ||
|
||
END { | ||
1 | ||
2 | ||
} | ||
|
||
#~# EXPECTED | ||
|
||
END { | ||
1 | ||
2 | ||
} | ||
|
||
#~# ORIGINAL | ||
|
||
END { 1 ; 2 } | ||
|
||
#~# EXPECTED | ||
|
||
END { 1; 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#~# ORIGINAL | ||
|
||
1 | ||
|
||
__END__ | ||
this | ||
is | ||
still | ||
here | ||
|
||
#~# EXPECTED | ||
|
||
1 | ||
|
||
__END__ | ||
this | ||
is | ||
still | ||
here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#~# ORIGINAL | ||
|
||
alias foo bar | ||
|
||
#~# EXPECTED | ||
|
||
alias foo bar | ||
|
||
#~# ORIGINAL | ||
|
||
alias :foo :bar | ||
|
||
#~# EXPECTED | ||
|
||
alias :foo :bar | ||
|
||
#~# ORIGINAL | ||
|
||
alias store []= | ||
|
||
#~# EXPECTED | ||
|
||
alias store []= | ||
|
||
#~# ORIGINAL | ||
|
||
alias $foo $bar | ||
|
||
#~# EXPECTED | ||
|
||
alias $foo $bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#~# ORIGINAL | ||
#~# align_assignments: true | ||
|
||
x = 1 | ||
xyz = 2 | ||
|
||
w = 3 | ||
|
||
#~# EXPECTED | ||
|
||
x = 1 | ||
xyz = 2 | ||
|
||
w = 3 | ||
|
||
#~# ORIGINAL | ||
#~# align_assignments: true | ||
|
||
x = 1 | ||
foo[bar] = 2 | ||
|
||
w = 3 | ||
|
||
#~# EXPECTED | ||
|
||
x = 1 | ||
foo[bar] = 2 | ||
|
||
w = 3 | ||
|
||
#~# ORIGINAL | ||
#~# align_assignments: true | ||
|
||
x = 1; x = 2 | ||
xyz = 2 | ||
|
||
w = 3 | ||
|
||
#~# EXPECTED | ||
|
||
x = 1; x = 2 | ||
xyz = 2 | ||
|
||
w = 3 | ||
|
||
#~# ORIGINAL | ||
#~# align_assignments: true | ||
|
||
a = begin | ||
b = 1 | ||
abc = 2 | ||
end | ||
|
||
#~# EXPECTED | ||
|
||
a = begin | ||
b = 1 | ||
abc = 2 | ||
end | ||
|
||
#~# ORIGINAL | ||
#~# align_assignments: true | ||
|
||
a = 1 | ||
a += 2 | ||
|
||
#~# EXPECTED | ||
|
||
a = 1 | ||
a += 2 | ||
|
||
#~# ORIGINAL | ||
#~# align_assignments: true | ||
|
||
foo = 1 | ||
a += 2 | ||
|
||
#~# EXPECTED | ||
|
||
foo = 1 | ||
a += 2 | ||
|
||
#~# ORIGINAL | ||
#~# align_assignments: false | ||
|
||
x = 1 | ||
xyz = 2 | ||
|
||
w = 3 | ||
|
||
#~# EXPECTED | ||
|
||
x = 1 | ||
xyz = 2 | ||
|
||
w = 3 | ||
|
Oops, something went wrong.