未验证 提交 bdcb444f 编写于 作者: K Kevin Ransom (msft) 提交者: GitHub

Fix test case (#13782)

Co-authored-by: NVlad Zarytovskii <vzaritovsky@hotmail.com>
上级 b7d2c75d
......@@ -11,16 +11,21 @@ open TestDoubles
[<Test>]
[<Ignore "Failing in main, disabling until resolved">]
let ``Help is displayed correctly`` () =
try
if System.Console.BufferWidth < 80 then
System.Console.BufferWidth <- 80
with _ -> ()
let builder = getArbitraryTcConfigBuilder()
builder.showBanner <- false // We don't need the banner
let blocks = GetCoreFscCompilerOptions builder
let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.txt"
let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.bsl"
let help = GetHelpFsc builder blocks
// contains instead of equals
// as we don't control the 1st line of the output (the version)
// it's tested separately
StringAssert.Contains(expectedHelp, help.Replace("\r\n", Environment.NewLine))
let actualHelp = help.Replace("\r\n", Environment.NewLine)
Assert.AreEqual(expectedHelp, actualHelp, $"Console width: {System.Console.BufferWidth}\nExpected: {expectedHelp}\n Actual: {actualHelp}") |> ignore
[<Test>]
let ``Version is displayed correctly`` () =
......
......@@ -20,7 +20,7 @@
</PropertyGroup>
<ItemGroup>
<Content Include="expected-help-output.txt">
<Content Include="expected-help-output.bsl">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Compile Include="..\fsharp\TestHelpers.fs" Link="TestHelpers.fs" />
......
Copyright (c) Microsoft Corporation. All Rights Reserved.

- OUTPUT FILES -
--out:<file> Name of the output file (Short form:
......@@ -23,6 +22,8 @@
run on: x86, x64, Arm, Arm64,
Itanium, anycpu32bitpreferred, or
anycpu. The default is anycpu.
--compressmetadata[+|-] Compress interface and optimization
data files
--nooptimizationdata Only include optimization
information essential for
implementing inlined constructs.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册