-
Notifications
You must be signed in to change notification settings - Fork 851
Open
Labels
Milestone
Description
StringInterpolation - interpolated strings executes exit 1 in a fsi session, killing the test run:
fsharp/tests/FSharp.Compiler.ComponentTests/InteractiveSession/Misc.fs
Lines 1994 to 2009 in 6609928
| [<Fact>] | |
| let ``StringInterpolation - interpolated strings``() = | |
| Fsx """ | |
| let name = "World" | |
| let count = 42 | |
| let greeting = $"Hello, {name}! Count: {count}" | |
| if greeting <> "Hello, World! Count: 42" then exit 1 | |
| let formatted = $"Pi is approximately {System.Math.PI:F2}" | |
| if not (formatted.Contains("3.14")) then exit 1 | |
| () | |
| """ | |
| |> withOptions ["--nologo"] | |
| |> runFsi | |
| |> shouldSucceed | |
| |> ignore |
A safeguard could be to preemptively shadow exit when creating a fsi session:
script.Eval("let exit _ = ...")The test fails locally because of system language settings. Apparently, I had CurrentUICulture En-US but CurrentCulture pl-PL. The latter decides about formatting.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New