11using System ;
22using System . Collections . Generic ;
3+ using System . Diagnostics ;
34using System . IO ;
45using System . Linq ;
56using System . Reflection ;
@@ -62,9 +63,9 @@ private static bool ReproduceTest(FileInfo fileInfo, SuitType suitType, bool che
6263 var debugAssertFailed = message != null && message . Contains ( "Debug.Assert failed" ) ;
6364 bool shouldInvoke = suitType switch
6465 {
65- SuitType . TestsOnly => ! test . IsError ,
66- SuitType . ErrorsOnly => test . IsError ,
67- SuitType . TestsAndErrors => ! debugAssertFailed ,
66+ SuitType . TestsOnly => ! test . IsError || fileMode ,
67+ SuitType . ErrorsOnly => test . IsError || fileMode ,
68+ SuitType . TestsAndErrors => ! debugAssertFailed || fileMode ,
6869 _ => false
6970 } ;
7071 if ( shouldInvoke )
@@ -79,6 +80,7 @@ private static bool ReproduceTest(FileInfo fileInfo, SuitType suitType, bool che
7980 }
8081 if ( checkResult && ! test . IsError && ! CompareObjects ( test . Expected , result ) )
8182 {
83+ Debug . Assert ( shouldInvoke ) ;
8284 // TODO: use NUnit?
8385 Console . ForegroundColor = ConsoleColor . Red ;
8486 Console . Error . WriteLine ( "Test {0} failed! Expected {1}, but got {2}" , fileInfo . Name ,
@@ -124,7 +126,7 @@ private static bool ReproduceTest(FileInfo fileInfo, SuitType suitType, bool che
124126 public static bool ReproduceTest ( FileInfo file , bool checkResult )
125127 {
126128 AppDomain . CurrentDomain . AssemblyResolve += TryLoadAssemblyFrom ;
127- return ReproduceTest ( file , SuitType . TestsAndErrors , checkResult ) ;
129+ return ReproduceTest ( file , SuitType . TestsAndErrors , checkResult , true ) ;
128130 }
129131
130132 public static bool ReproduceTests ( DirectoryInfo testsDir , SuitType suitType = SuitType . TestsAndErrors )
0 commit comments