@@ -584,96 +584,4 @@ type AsyncModule() =
584584 Assert.AreEqual( 0 , ! okCount)
585585 Assert.AreEqual( 0 , ! errCount)
586586#endif
587- #endif
588-
589- #if FSHARP_ CORE_ PORTABLE
590- // nothing
591- #else
592- #if FSHARP_ CORE_ 2_ 0
593- // nothing
594- #else
595- #if FSHARP_ CORE_ NETCORE_ PORTABLE || coreclr
596- //nothing
597- #else
598- // we are on the desktop
599- member this.RunExeAndExpectOutput ( exeName , expected : string ) =
600- let curDir = ( new Uri( System.Reflection.Assembly.GetExecutingAssembly() .CodeBase)) .LocalPath |> System.IO.Path.GetDirectoryName
601- let psi = System.Diagnostics.ProcessStartInfo( exeName)
602- psi.WorkingDirectory <- curDir
603- psi.RedirectStandardOutput <- true
604- psi.UseShellExecute <- false
605- let p = System.Diagnostics.Process.Start( psi)
606- let out = p.StandardOutput.ReadToEnd()
607- p.WaitForExit()
608- let out = out.Replace( " \r\n " , " \n " )
609- let expected = expected.Replace( " \r\n " , " \n " )
610- Assert.AreEqual( expected, out)
611- #if OPEN_ BUILD
612- #else
613- [<Test>]
614- member this. ``ContinuationsThreadingDetails.AsyncWithSyncContext`` () =
615- this.RunExeAndExpectOutput( " AsyncWithSyncContext.exe" , """
616- EmptyParallel [|("ok", true); ("caught:boom", true)|]
617- NonEmptyParallel [|("ok", true); ("form exception:boom", true)|]
618- ParallelSeqArgumentThrows [|("error", true)|]
619- Sleep1Return [|("ok", true); ("form exception:boom", true)|]
620- Sleep0Return [|("ok", true); ("form exception:boom", true)|]
621- Return [|("ok", true); ("caught:boom", true)|]
622- FromContinuationsSuccess [|("ok", true); ("caught:boom", true)|]
623- FromContinuationsError [|("error", true)|]
624- FromContinuationsCancel [|("cancel", true)|]
625- FromContinuationsThrows [|("error", true)|]
626- FromContinuationsSchedulesFutureSuccess [|("ok", false); ("unhandled", false)|]
627- FromContinuationsSchedulesFutureError [|("error", false)|]
628- FromContinuationsSchedulesFutureCancel [|("cancel", false)|]
629- FromContinuationsSchedulesFutureSuccessAndThrowsQuickly [|("error", true); ("unhandled", false)|]
630- FromContinuationsSchedulesFutureErrorAndThrowsQuickly [|("error", true); ("unhandled", false)|]
631- FromContinuationsSchedulesFutureCancelAndThrowsQuickly [|("error", true); ("unhandled", false)|]
632- FromContinuationsSchedulesFutureSuccessAndThrowsSlowly [|("ok", false); ("unhandled", false);
633- ("caught:A continuation provided by Async.FromContinuations was invoked multiple times",
634- true)|]
635- FromContinuationsSchedulesFutureErrorAndThrowsSlowly [|("error", false);
636- ("caught:A continuation provided by Async.FromContinuations was invoked multiple times",
637- true)|]
638- FromContinuationsSchedulesFutureCancelAndThrowsSlowly [|("cancel", false);
639- ("caught:A continuation provided by Async.FromContinuations was invoked multiple times",
640- true)|]
641- AwaitWaitHandleAlreadySignaled0 [|("ok", true); ("caught:boom", true)|]
642- AwaitWaitHandleAlreadySignaled1 [|("ok", true); ("form exception:boom", true)|]
643- """ )
644- [<Test>]
645- member this. ``ContinuationsThreadingDetails.AsyncSansSyncContext`` () =
646- this.RunExeAndExpectOutput( " AsyncSansSyncContext.exe" , """
647- EmptyParallel [|("ok", true); ("caught:boom", true)|]
648- NonEmptyParallel [|("ok", false); ("unhandled", false)|]
649- ParallelSeqArgumentThrows [|("error", true)|]
650- Sleep1Return [|("ok", false); ("unhandled", false)|]
651- Sleep0Return [|("ok", false); ("unhandled", false)|]
652- Return [|("ok", true); ("caught:boom", true)|]
653- FromContinuationsSuccess [|("ok", true); ("caught:boom", true)|]
654- FromContinuationsError [|("error", true)|]
655- FromContinuationsCancel [|("cancel", true)|]
656- FromContinuationsThrows [|("error", true)|]
657- FromContinuationsSchedulesFutureSuccess [|("ok", false); ("unhandled", false)|]
658- FromContinuationsSchedulesFutureError [|("error", false)|]
659- FromContinuationsSchedulesFutureCancel [|("cancel", false)|]
660- FromContinuationsSchedulesFutureSuccessAndThrowsQuickly [|("error", true); ("unhandled", false)|]
661- FromContinuationsSchedulesFutureErrorAndThrowsQuickly [|("error", true); ("unhandled", false)|]
662- FromContinuationsSchedulesFutureCancelAndThrowsQuickly [|("error", true); ("unhandled", false)|]
663- FromContinuationsSchedulesFutureSuccessAndThrowsSlowly [|("ok", false); ("unhandled", false);
664- ("caught:A continuation provided by Async.FromContinuations was invoked multiple times",
665- true)|]
666- FromContinuationsSchedulesFutureErrorAndThrowsSlowly [|("error", false);
667- ("caught:A continuation provided by Async.FromContinuations was invoked multiple times",
668- true)|]
669- FromContinuationsSchedulesFutureCancelAndThrowsSlowly [|("cancel", false);
670- ("caught:A continuation provided by Async.FromContinuations was invoked multiple times",
671- true)|]
672- AwaitWaitHandleAlreadySignaled0 [|("ok", true); ("caught:boom", true)|]
673- AwaitWaitHandleAlreadySignaled1 [|("ok", false); ("unhandled", false)|]
674- """ )
675- #endif
676-
677- #endif
678- #endif
679587#endif
0 commit comments