File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ export class JUnitRunnerResultAnalyzer extends RunnerResultAnalyzer {
5454
5555 public analyzeData ( data : string ) : void {
5656 const lines : string [ ] = data . split ( / \r ? \n / ) ;
57- for ( const line of lines ) {
57+ const endsWithNewLine : boolean = / \r ? \n $ / . test ( data ) ;
58+ for ( let i : number = 0 ; i < lines . length ; i ++ ) {
59+ const line : string = lines [ i ] ;
60+ if ( i === lines . length - 1 && endsWithNewLine && line === '' ) {
61+ continue ;
62+ }
5863 this . processData ( line ) ;
5964 // Hide Eclipse RemoteTestRunner protocol frames already consumed by processData().
6065 // Forward everything else, including stdout/stderr and trace payload lines.
Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ at org.junit.Assert.assertTrue(Assert.java:53)
7070at junit4.TestAnnotation.shouldFail(TestAnnotation.java:15)
7171%TRACEE
7272%TESTE 1,shouldFail(junit4.TestAnnotation)
73- %RUNTIME20` ;
73+ %RUNTIME20
74+ ` ;
7475 const runnerContext : IRunTestContext = {
7576 isDebug : false ,
7677 kind : TestKind . JUnit ,
@@ -150,6 +151,7 @@ at junit4.TestAnnotation.shouldFail(TestAnnotation.java:15)
150151 assert . ok ( echoedLines . includes ( '%OK' ) , 'Percent-prefixed program output was dropped' ) ;
151152 assert . ok ( echoedLines . includes ( '%ABC' ) , 'Percent-prefixed program output was dropped' ) ;
152153 assert . ok ( echoedLines . includes ( 'java.lang.AssertionError' ) , 'Stack trace content was dropped' ) ;
154+ assert . ok ( ! echoedLines . includes ( '' ) , 'Trailing newline produced a blank output line' ) ;
153155 } ) ;
154156
155157 test ( "test stacktrace should be simplified" , ( ) => {
You can’t perform that action at this time.
0 commit comments