@@ -775,11 +775,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
775
775
await assertLocalVariableValue ( 'strdat' , '"Goodbye, World."' ) ;
776
776
} ) ;
777
777
778
- test ( 'should run program with cwd set (noDebug)' , async function ( ) {
779
- if ( isDlvDap && dlvDapSkipsEnabled ) {
780
- this . skip ( ) ; // OutputEvents not implemented
781
- }
782
-
778
+ test ( 'should run program with cwd set (noDebug)' , async ( ) => {
783
779
const WD = path . join ( DATA_ROOT , 'cwdTest' ) ;
784
780
const PROGRAM = path . join ( WD , 'cwdTest' ) ;
785
781
@@ -793,19 +789,15 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
793
789
noDebug : true
794
790
} ;
795
791
const debugConfig = await initializeDebugConfig ( config ) ;
796
- await Promise . all ( [
797
- dc . launch ( debugConfig ) ,
798
- dc . waitForEvent ( 'output' ) . then ( ( event ) => {
799
- assert . strictEqual ( event . body . output , 'Hello, World!\n' ) ;
800
- } )
801
- ] ) ;
802
- } ) ;
803
-
804
- test ( 'should run program without cwd set (noDebug)' , async function ( ) {
805
- if ( isDlvDap && dlvDapSkipsEnabled ) {
806
- this . skip ( ) ; // OutputEvents not implemented
792
+ dc . launch ( debugConfig ) ;
793
+ let found = false ;
794
+ while ( ! found ) {
795
+ const event = await dc . waitForEvent ( 'output' ) ;
796
+ found = event . body . output === 'Hello, World!\n' ;
807
797
}
798
+ } ) ;
808
799
800
+ test ( 'should run program without cwd set (noDebug)' , async ( ) => {
809
801
const WD = path . join ( DATA_ROOT , 'cwdTest' ) ;
810
802
const PROGRAM = path . join ( WD , 'cwdTest' ) ;
811
803
@@ -818,19 +810,15 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
818
810
noDebug : true
819
811
} ;
820
812
const debugConfig = await initializeDebugConfig ( config ) ;
821
- await Promise . all ( [
822
- dc . launch ( debugConfig ) ,
823
- dc . waitForEvent ( 'output' ) . then ( ( event ) => {
824
- assert . strictEqual ( event . body . output , 'Goodbye, World.\n' ) ;
825
- } )
826
- ] ) ;
827
- } ) ;
828
-
829
- test ( 'should run file program with cwd set (noDebug)' , async function ( ) {
830
- if ( isDlvDap && dlvDapSkipsEnabled ) {
831
- this . skip ( ) ; // OutputEvents not implemented
813
+ dc . launch ( debugConfig ) ;
814
+ let found = false ;
815
+ while ( ! found ) {
816
+ const event = await dc . waitForEvent ( 'output' ) ;
817
+ found = event . body . output === 'Goodbye, World.\n' ;
832
818
}
819
+ } ) ;
833
820
821
+ test ( 'should run file program with cwd set (noDebug)' , async ( ) => {
834
822
const WD = path . join ( DATA_ROOT , 'cwdTest' ) ;
835
823
const PROGRAM = path . join ( WD , 'cwdTest' , 'main.go' ) ;
836
824
@@ -844,19 +832,15 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
844
832
noDebug : true
845
833
} ;
846
834
const debugConfig = await initializeDebugConfig ( config ) ;
847
- await Promise . all ( [
848
- dc . launch ( debugConfig ) ,
849
- dc . waitForEvent ( 'output' ) . then ( ( event ) => {
850
- assert . strictEqual ( event . body . output , 'Hello, World!\n' ) ;
851
- } )
852
- ] ) ;
853
- } ) ;
854
-
855
- test ( 'should run file program without cwd set (noDebug)' , async function ( ) {
856
- if ( isDlvDap && dlvDapSkipsEnabled ) {
857
- this . skip ( ) ; // OutputEvents not implemented
835
+ dc . launch ( debugConfig ) ;
836
+ let found = false ;
837
+ while ( ! found ) {
838
+ const event = await dc . waitForEvent ( 'output' ) ;
839
+ found = event . body . output === 'Hello, World!\n' ;
858
840
}
841
+ } ) ;
859
842
843
+ test ( 'should run file program without cwd set (noDebug)' , async ( ) => {
860
844
const WD = path . join ( DATA_ROOT , 'cwdTest' ) ;
861
845
const PROGRAM = path . join ( WD , 'cwdTest' , 'main.go' ) ;
862
846
@@ -869,12 +853,12 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
869
853
noDebug : true
870
854
} ;
871
855
const debugConfig = await initializeDebugConfig ( config ) ;
872
- await Promise . all ( [
873
- dc . launch ( debugConfig ) ,
874
- dc . waitForEvent ( 'output' ) . then ( ( event ) => {
875
- assert . strictEqual ( event . body . output , 'Goodbye, World.\n ') ;
876
- } )
877
- ] ) ;
856
+ dc . launch ( debugConfig ) ;
857
+ let found = false ;
858
+ while ( ! found ) {
859
+ const event = await dc . waitForEvent ( 'output ') ;
860
+ found = event . body . output === 'Goodbye, World.\n' ;
861
+ }
878
862
} ) ;
879
863
} ) ;
880
864
0 commit comments