You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;"""
735
-
""" #quit;; // Exit"""
736
-
""""""
737
-
""" F# Interactive command line options:"""
738
-
""""""
739
-
740
-
// this is the end of the line each different platform has a different mechanism for starting fsi
741
-
// Actual output looks similar to: """ See 'testhost --help' for options"""
742
-
"""--help' for options"""
743
-
744
-
""""""
745
-
""""""
746
-
|]
724
+
letexpected="""
725
+
F# Interactive directives:
726
+
727
+
#r "file.dll";; // Reference (dynamically load) the given DLL
728
+
#i "package source uri";; // Include package source uri when searching for packages
729
+
#I "path";; // Add the given search path for referenced DLLs
730
+
#load "file.fs" ...;; // Load the given file(s) as if compiled and referenced
731
+
#time ["on"|"off"];; // Toggle timing on/off
732
+
#help;; // Display help
733
+
#help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;
734
+
#clear;; // Clear screen
735
+
#quit;; // Exit
736
+
737
+
F# Interactive command line options:"""
747
738
748
-
let mutablefound=0
749
-
letlines= System.Collections.Generic.List()
750
-
use sawExpectedOutput =new ManualResetEvent(false)
751
-
letverifyOutput(line:string)=
752
-
letcompareLine(s:string)=
753
-
if s =""then line =""
754
-
else line.EndsWith(s)
755
-
lines.Add(line)
756
-
match expected |> Array.tryFind(compareLine)with
757
-
| None ->()
758
-
| Some t ->
759
-
found <- found +1
760
-
if found = expected.Length then sawExpectedOutput.Set()|> ignore
761
-
762
-
lettext="#help"
763
739
use script =new FSharpScript(quiet =false, langVersion = LangVersion.V47)
764
-
let mutablefound=0
765
-
script.OutputProduced.Add (fun line -> verifyOutput line)
766
-
letopt= script.Eval(text)|> getValue
767
-
Assert.True(sawExpectedOutput.WaitOne(TimeSpan.FromSeconds(5.0)), sprintf "Expected to see error sentinel value written\nexpected:%A\nactual:%A" expected lines)
768
740
741
+
use capture =new TestConsole.ExecutionCapture()
742
+
letopt= script.Eval("#help")|> getValue
743
+
744
+
letoutput= capture.OutText
745
+
746
+
Assert.Contains(expected, output)
747
+
748
+
// this is the end of the line each different platform has a different mechanism for starting fsi
749
+
// Actual output looks similar to: """ See 'testhost --help' for options"""
750
+
Assert.EndsWith("--help' for options", output.Trim())
769
751
770
752
[<Fact>]
771
753
member_.``Verify that #help produces help text for fsi +dependency manager language version preview``()=
772
-
letexpected=[|
773
-
""" F# Interactive directives:"""
774
-
""""""
775
-
""" #r "file.dll";; // Reference (dynamically load) the given DLL"""
776
-
""" #i "package source uri";; // Include package source uri when searching for packages"""
777
-
""" #I "path";; // Add the given search path for referenced DLLs"""
778
-
""" #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced"""
""" #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version"""
784
-
""" #clear;; // Clear screen"""
785
-
""" #quit;; // Exit"""
786
-
""""""
787
-
""" F# Interactive command line options:"""
788
-
""""""
789
-
790
-
// this is the end of the line each different platform has a different mechanism for starting fsi
791
-
// Actual output looks similar to: """ See 'testhost --help' for options"""
792
-
"""--help' for options"""
793
-
794
-
""""""
795
-
""""""
796
-
|]
754
+
letexpected="""
755
+
F# Interactive directives:
756
+
757
+
#r "file.dll";; // Reference (dynamically load) the given DLL
758
+
#i "package source uri";; // Include package source uri when searching for packages
759
+
#I "path";; // Add the given search path for referenced DLLs
760
+
#load "file.fs" ...;; // Load the given file(s) as if compiled and referenced
761
+
#time ["on"|"off"];; // Toggle timing on/off
762
+
#help;; // Display help
763
+
#help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;
764
+
#r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'
765
+
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
766
+
#clear;; // Clear screen
767
+
#quit;; // Exit
768
+
769
+
F# Interactive command line options:"""
797
770
798
-
let mutablefound=0
799
-
letlines= System.Collections.Generic.List()
800
-
use sawExpectedOutput =new ManualResetEvent(false)
801
-
letverifyOutput(line:string)=
802
-
letcompareLine(s:string)=
803
-
if s =""then line =""
804
-
else line.EndsWith(s)
805
-
lines.Add(line)
806
-
match expected |> Array.tryFind(compareLine)with
807
-
| None ->()
808
-
| Some t ->
809
-
found <- found +1
810
-
if found = expected.Length then sawExpectedOutput.Set()|> ignore
811
-
812
-
lettext="#help"
813
771
use script =new FSharpScript(quiet =false, langVersion = LangVersion.Preview)
814
-
let mutablefound=0
815
-
script.OutputProduced.Add (fun line -> verifyOutput line)
816
-
letopt= script.Eval(text)|> getValue
817
-
Assert.True(sawExpectedOutput.WaitOne(TimeSpan.FromSeconds(5.0)), sprintf "Expected to see error sentinel value written\nexpected:%A\nactual:%A" expected lines)
818
772
773
+
use capture =new TestConsole.ExecutionCapture()
774
+
letopt= script.Eval("#help")|> getValue
775
+
776
+
letoutput= capture.OutText
777
+
778
+
Assert.Contains(expected, output)
779
+
780
+
// this is the end of the line each different platform has a different mechanism for starting fsi
781
+
// Actual output looks similar to: """ See 'testhost --help' for options"""
782
+
Assert.EndsWith("--help' for options", output.Trim())
819
783
820
784
[<Fact>]
821
785
member_.``Verify that timeout ---times out and fails``()=
0 commit comments