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
15 changes: 10 additions & 5 deletions tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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`` () =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) Microsoft Corporation. All Rights Reserved.



- OUTPUT FILES -
--out:<file> Name of the output file (Short form:
Expand All @@ -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.
Expand Down