@@ -1411,6 +1411,14 @@ describe('Terminal utils', function() {
1411
1411
var output = $ . terminal . split_equal ( text , 100 , true ) ;
1412
1412
expect ( output ) . toEqual ( [ $ . terminal . normalize ( text ) ] ) ;
1413
1413
} ) ;
1414
+ it ( 'should retain leading spaces' , function ( ) {
1415
+ var text = `This
1416
+ is
1417
+ a
1418
+ test` ;
1419
+ var output = $ . terminal . split_equal ( text , 100 , true ) ;
1420
+ expect ( output ) . toEqual ( text . split ( '\n' ) ) ;
1421
+ } ) ;
1414
1422
} ) ;
1415
1423
describe ( 'Cycle' , function ( ) {
1416
1424
describe ( 'create' , function ( ) {
@@ -5879,7 +5887,7 @@ describe('Terminal plugin', function() {
5879
5887
term . clear ( ) . echo ( line , { keepWords : true } ) ;
5880
5888
expect ( output ( ) ) . toEqual ( lines ) ;
5881
5889
} ) ;
5882
- it ( 'should strip whitespace' , function ( ) {
5890
+ it ( 'should strip traling whitespace' , function ( ) {
5883
5891
var words = [ 'lorem' , 'ipsum' , 'dolor' , 'sit' , 'amet' ] ;
5884
5892
var input = [ ] ;
5885
5893
var i ;
@@ -5891,7 +5899,7 @@ describe('Terminal plugin', function() {
5891
5899
for ( i = 80 ; i < 200 ; i += 10 ) {
5892
5900
term . option ( 'numChars' , i ) ;
5893
5901
output ( ) . forEach ( function ( line ) {
5894
- expect ( line . match ( / ^ \s + | \s + $ / ) ) . toBeFalsy ( ) ;
5902
+ expect ( line . match ( / \s + $ / ) ) . toBeFalsy ( ) ;
5895
5903
} ) ;
5896
5904
}
5897
5905
term . option ( 'numChars' , numChars ) ;
0 commit comments