diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index 943b491038505d1e1450729ab9f3f614855ad6fe..332c5cbdee77612a30e29fed36750b1e37a16337 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -11,16 +11,21 @@ open TestDoubles [] [] 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 [] let ``Version is displayed correctly`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 81f470dcbcd8c73e1930818cf20111c32491d24c..30e2e9c933ca0921339d87c1661e381edb9e022a 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -20,7 +20,7 @@ - + Never diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl similarity index 98% rename from tests/FSharp.Compiler.Service.Tests/expected-help-output.txt rename to tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index 7d787f6ceb45796cf12318639603ee103f1a5af9..6be21d85f3c84babdc4a3308568a1c0c81c2b5fd 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -1,5 +1,4 @@ -Copyright (c) Microsoft Corporation. All Rights Reserved. - + - OUTPUT FILES - --out: 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.