@@ -436,7 +436,7 @@ suite('NotebookTextModel', () => {
436
436
) ;
437
437
} ) ;
438
438
439
- test ( 'appending streaming outputs with compression' , async function ( ) {
439
+ test ( 'appending streaming outputs with move cursor compression' , async function ( ) {
440
440
441
441
await withTestNotebook (
442
442
[
@@ -478,6 +478,48 @@ suite('NotebookTextModel', () => {
478
478
) ;
479
479
} ) ;
480
480
481
+ test ( 'appending streaming outputs with carraige return compression' , async function ( ) {
482
+
483
+ await withTestNotebook (
484
+ [
485
+ [ 'var a = 1;' , 'javascript' , CellKind . Code , [ ] , { } ] ,
486
+ ] ,
487
+ ( editor ) => {
488
+ const textModel = editor . textModel ;
489
+
490
+ textModel . applyEdits ( [
491
+ {
492
+ index : 0 ,
493
+ editType : CellEditType . Output ,
494
+ append : true ,
495
+ outputs : [ {
496
+ outputId : 'append1' ,
497
+ outputs : [
498
+ { mime : stdOutMime , data : valueBytesFromString ( 'append 1' ) } ,
499
+ { mime : stdOutMime , data : valueBytesFromString ( '\nappend 1' ) } ]
500
+ } ]
501
+ } ] , true , undefined , ( ) => undefined , undefined , true ) ;
502
+ const [ output ] = textModel . cells [ 0 ] . outputs ;
503
+ assert . strictEqual ( output . versionId , 0 , 'initial output version should be 0' ) ;
504
+
505
+ textModel . applyEdits ( [
506
+ {
507
+ editType : CellEditType . OutputItems ,
508
+ append : true ,
509
+ outputId : 'append1' ,
510
+ items : [ {
511
+ mime : stdOutMime , data : valueBytesFromString ( '\rappend 2' )
512
+ } ]
513
+ } ] , true , undefined , ( ) => undefined , undefined , true ) ;
514
+ assert . strictEqual ( output . versionId , 1 , 'version should bump per append' ) ;
515
+
516
+ assert . strictEqual ( output . outputs [ 0 ] . data . toString ( ) , 'append 1\nappend 2' ) ;
517
+ assert . strictEqual ( output . appendedSinceVersion ( 0 , stdOutMime ) , undefined ,
518
+ 'compressing outputs should clear out previous versioned output buffers' ) ;
519
+ }
520
+ ) ;
521
+ } ) ;
522
+
481
523
test ( 'appending multiple different mime streaming outputs' , async function ( ) {
482
524
await withTestNotebook (
483
525
[
0 commit comments