mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 01:01:35 +01:00
Stop dumbindent adding or removing line breaks
This commit is contained in:
1 parent
b82396a3c6
commit
b1ea22045a
3 files changed
+54
-123
No files matched your search
@@ -68,9 +68,9 @@ func TestFormatBytes(tt *testing.T) {
|
||||
src: "if (b) {\nlabel:\nswitch (i) {\ncase 0:\nj = k\nbreak;\n}\n}\n",
|
||||
want: "if (b) {\n label:\n switch (i) {\n case 0:\n j = k\n break;\n }\n}\n",
|
||||
}, {
|
||||
// Inserted line breaks.
|
||||
// One-liner if statement.
|
||||
src: "if (x) { goto fail; }\n",
|
||||
want: "if (x) {\n goto fail;\n}\n",
|
||||
want: "if (x) { goto fail; }\n",
|
||||
}, {
|
||||
// Leading blank lines.
|
||||
src: "\n\n\n x = y;",
|
||||
@@ -108,7 +108,7 @@ func TestTabs(tt *testing.T) {
|
||||
func ExampleFormatBytes() {
|
||||
const src = `
|
||||
for (i = 0; i < 3; i++) {
|
||||
j = 0; j++; // Semi-colons not within parentheses.
|
||||
j = 0; // Ignore { in a comment.
|
||||
if (i < j) { foo(); }
|
||||
u = (v +
|
||||
w);
|
||||
@@ -119,11 +119,8 @@ w);
|
||||
|
||||
// Output:
|
||||
// for (i = 0; i < 3; i++) {
|
||||
// j = 0;
|
||||
// j++; // Semi-colons not within parentheses.
|
||||
// if (i < j) {
|
||||
// foo();
|
||||
// }
|
||||
// j = 0; // Ignore { in a comment.
|
||||
// if (i < j) { foo(); }
|
||||
// u = (v +
|
||||
// w);
|
||||
// }
|
||||
|
||||
Reference in new issue
Block a user