StringInterpolation - interpolated strings executes exit 1 in a fsi session, killing the test run:
|
[<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.
StringInterpolation - interpolated stringsexecutesexit 1in a fsi session, killing the test run:fsharp/tests/FSharp.Compiler.ComponentTests/InteractiveSession/Misc.fs
Lines 1994 to 2009 in 6609928
A safeguard could be to preemptively shadow
exitwhen creating a fsi session:The test fails locally because of system language settings. Apparently, I had
CurrentUICultureEn-US butCurrentCulturepl-PL. The latter decides about formatting.