@@ -19,6 +19,7 @@ type StringTransformationTest = [
19
19
let editor : vscode . TextEditor ;
20
20
let document : vscode . TextDocument ;
21
21
const originalShowInputBox = vscode . window . showInputBox ;
22
+ const stripNewlines = ( str : string ) => str . replace ( / [ \n \r ] / g, "" ) ;
22
23
23
24
suite ( "Extension Test Suite" , ( ) => {
24
25
beforeEach ( async ( ) => {
@@ -50,7 +51,9 @@ suite("Extension Test Suite", () => {
50
51
} ) ;
51
52
await vscode . commands . executeCommand ( commandName ) ;
52
53
return Promise . resolve (
53
- editor . selections . map ( ( selection ) => editor . document . getText ( selection ) )
54
+ editor . selections . map ( ( selection ) =>
55
+ stripNewlines ( editor . document . getText ( selection ) )
56
+ )
54
57
) ;
55
58
} ;
56
59
@@ -375,8 +378,8 @@ suite("Extension Test Suite", () => {
375
378
) ;
376
379
377
380
assert . strictEqual ( output1 , "a2 b3 c4 5d 6e 7f 13x y24 35z46" ) ;
378
- assert . strictEqual ( output2 , "a2 b3 c4 5d 6e\n7f 13x y24 35z46" ) ;
379
- assert . strictEqual ( output3 , "a-3 b-2 c-1 0d 1e\n7f 13x y24 35z46" ) ;
381
+ assert . strictEqual ( output2 , "a2 b3 c4 5d 6e7f 13x y24 35z46" ) ;
382
+ assert . strictEqual ( output3 , "a-3 b-2 c-1 0d 1e7f 13x y24 35z46" ) ;
380
383
} ) ;
381
384
382
385
test ( "decrement" , async ( ) => {
@@ -399,8 +402,8 @@ suite("Extension Test Suite", () => {
399
402
) ;
400
403
401
404
assert . strictEqual ( output1 , "a0 b1 c2 3d 4e 5f 11x y22 33z44" ) ;
402
- assert . strictEqual ( output2 , "a0 b1 c2 3d\n4e 5f 11x y22 33z44" ) ;
403
- assert . strictEqual ( output3 , "a-4 b-3 c-2 -1d\n0e 5f 11x y22 33z44" ) ;
405
+ assert . strictEqual ( output2 , "a0 b1 c2 3d4e 5f 11x y22 33z44" ) ;
406
+ assert . strictEqual ( output3 , "a-4 b-3 c-2 -1d0e 5f 11x y22 33z44" ) ;
404
407
} ) ;
405
408
406
409
test ( "duplicateAndIncrement" , async ( ) => {
@@ -416,7 +419,7 @@ suite("Extension Test Suite", () => {
416
419
417
420
assert . strictEqual (
418
421
output ,
419
- "a1 b2 c3 4d 5e 6f 12x y23 34z45a2 b3 c4 5d 6e 7f 13x y24 35z46\n "
422
+ "a1 b2 c3 4d 5e 6f 12x y23 34z45a2 b3 c4 5d 6e 7f 13x y24 35z46"
420
423
) ;
421
424
} ) ;
422
425
@@ -433,7 +436,7 @@ suite("Extension Test Suite", () => {
433
436
434
437
assert . strictEqual (
435
438
output ,
436
- "a1 b2 c3 4d 5e 6f 12x y23 34z45a0 b1 c2 3d 4e 5f 11x y22 33z44\n "
439
+ "a1 b2 c3 4d 5e 6f 12x y23 34z45a0 b1 c2 3d 4e 5f 11x y22 33z44"
437
440
) ;
438
441
} ) ;
439
442
@@ -453,7 +456,7 @@ suite("Extension Test Suite", () => {
453
456
) ;
454
457
455
458
assert . strictEqual ( output1 , "a1 b2 c3 4d 5e 6f 7x y8 9z10" ) ;
456
- assert . strictEqual ( output2 , "a11 b12 c13\n14d 15e 16f 17x y18 19z20" ) ;
459
+ assert . strictEqual ( output2 , "a11 b12 c1314d 15e 16f 17x y18 19z20" ) ;
457
460
} ) ;
458
461
459
462
test ( "utf8ToChar" , async ( ) => {
0 commit comments