Skip to content

Commit 40aaf38

Browse files
committed
Add test for automatic unindent
1 parent caa9569 commit 40aaf38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/tester.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,10 @@ console.log("I've got another line!", 2 < 3, "should be true.");
531531
backspace(textarea);
532532

533533
testAddingText("Indent-AutoCloseBrackets", textarea, function(textarea) {
534-
addText(textarea, `function printTriples(max) {\nfor(let i = 0; i < max-2; i++) {\nfor(let j = 0; j < max-1; j++) {\nfor(let k = 0; k < max; k++) {\nconsole.log(i,j,k);\n}\n//Hmmm...`, true);
535-
}, 'function printTriples(max) {\n for(let i = 0; i < max-2; i++) {\n for(let j = 0; j < max-1; j++) {\n for(let k = 0; k < max; k++) {\n console.log(i,j,k);\n }\n //Hmmm...\n }\n }\n }\n}', 189, 189);
534+
addText(textarea, `function printTriples(max) {\nfor(let i = 0; i < max-2; i++) {\nfor(let j = 0; j < max-1; j++) {\nfor(let k = 0; k < max; k++) {\nconsole.log(i,j,k);\n}\n//Hmmm...\n}//Test auto-unindent\n{`, true);
535+
move(textarea, 1); // Move after created closing bracket
536+
backspace(textarea); // Remove created closing bracket
537+
}, 'function printTriples(max) {\n for(let i = 0; i < max-2; i++) {\n for(let j = 0; j < max-1; j++) {\n for(let k = 0; k < max; k++) {\n console.log(i,j,k);\n }\n //Hmmm...\n }//Test auto-unindent\n {\n }\n }\n }\n}', 221, 211);
536538

537539
// SelectTokenCallbacks
538540
if(isHLJS) {

0 commit comments

Comments
 (0)