Have dumbindent no longer treat labels specially

This commit is contained in:
Nigel Tao committed 2020-06-06 22:38:29 +10:00
1 parent 6424bae087
commit 0ad5f9b617
3 files changed
+229 -254

No files matched your search

+2 -2
View File
@@ -63,9 +63,9 @@ func TestFormatBytes(tt *testing.T) {
src: " a['key'] = /*{\n\n\nX*/ ; \nb = {\nc = 0\n",
want: "a['key'] = /*{\n\n\nX*/ ;\nb = {\n c = 0\n",
}, {
// Label.
// Nested blocks with label.
src: "if (b) {\nlabel:\nswitch (i) {\ncase 0:\nj = k\nbreak;\n}\n}\n",
want: "if (b) {\nlabel:\n switch (i) {\n case 0:\n j = k\n break;\n }\n}\n",
want: "if (b) {\n label:\n switch (i) {\n case 0:\n j = k\n break;\n }\n}\n",
}}
for i, tc := range testCases {