Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let test =
sprintf "%1A" [1..5] = "[1;\n 2;\n 3;\n 4;\n 5]" &&
sprintf "%13A" [|1..5|] = "[|1; 2; 3; 4;\n 5|]" &&
sprintf "%3.1A" {1..3} = "seq\n [1;\n ...]"
sprintf "%3.1A" (seq {1..3}) = "seq\n [1;\n ...]"

match test with
| false -> raise (new System.Exception("LazyValues03 failed - this should never be forced"))
Expand Down
4 changes: 2 additions & 2 deletions tests/FSharp.Test.Utilities/Compiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ module rec Compiler =


let private evalFSharp (fs: FSharpCompilationSource) (script:FSharpScript) : CompilationResult =
let source = fs.Source.GetSourceText |> Option.defaultValue ""
let source = fs.Source.GetSourceText |> Option.defaultWith fs.Source.LoadSourceText
use capture = new TestConsole.ExecutionCapture()
let result = script.Eval(source)
let outputWritten, errorsWritten = capture.OutText, capture.ErrorText
Expand Down Expand Up @@ -1191,7 +1191,7 @@ module rec Compiler =
let runFsi (cUnit: CompilationUnit) : CompilationResult =
match cUnit with
| FS fs ->
let source = fs.Source.GetSourceText |> Option.defaultValue ""
let source = fs.Source.GetSourceText |> Option.defaultWith fs.Source.LoadSourceText
let name = fs.Name |> Option.defaultValue "unnamed"
let options = fs.Options |> Array.ofList
let outputDirectory =
Expand Down
2 changes: 2 additions & 0 deletions tests/FSharp.Test.Utilities/CompilerAssert.fs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ type SourceCodeFileKind =
| Fsi s -> s.FileName
| Cs s -> s.FileName

member this.LoadSourceText() = FileSystem.OpenFileForReadShim(this.GetSourceFileName).ReadAllText()

member this.GetSourceText =
match this with
| Fs s -> s.SourceText
Expand Down
Loading