@@ -5,9 +5,7 @@ namespace FSharp.Test
55open FSharp.Compiler .Interactive .Shell
66open FSharp.Compiler .IO
77open FSharp.Compiler .Diagnostics
8- open FSharp.Compiler .Symbols
98open FSharp.Compiler .Text
10- open FSharp.Test .Assert
119open FSharp.Test .Utilities
1210open FSharp.Test .ScriptHelpers
1311open Microsoft.CodeAnalysis
@@ -27,9 +25,10 @@ open TestFramework
2725
2826open System.Runtime .CompilerServices
2927open System.Runtime .InteropServices
30- open FSharp.Compiler .CodeAnalysis
3128
3229module rec Compiler =
30+ let shouldUpdateBaselines =
31+ Environment.GetEnvironmentVariable( " TEST_UPDATE_BSL" ) <> null
3332
3433 [<AutoOpen>]
3534 type SourceUtilities () =
@@ -1230,10 +1229,8 @@ Expected:
12301229{expected}
12311230Actual:
12321231{actual}"""
1233- let updateBaseline () =
1234- snd ( Int32.TryParse( Environment.GetEnvironmentVariable( " TEST_UPDATE_BSL" ))) <> 0
12351232 let updateBaseLineIfEnvironmentSaysSo baseline =
1236- if updateBaseline () then
1233+ if shouldUpdateBaselines then
12371234 if FileSystem.FileExistsShim baseline.FilePath then
12381235 FileSystem.CopyShim( baseline.FilePath, baseline.BslSource, true )
12391236
@@ -2020,7 +2017,7 @@ Actual:
20202017 match Assert.shouldBeSameMultilineStringSets expectedContent actualErrors with
20212018 | None -> ()
20222019 | Some diff ->
2023- if Environment.GetEnvironmentVariable ( " TEST_UPDATE_BSL " ) <> null then
2020+ if shouldUpdateBaselines then
20242021 File.WriteAllText( path, actualErrors)
20252022
20262023 printfn $" {Path.GetFullPath path} \n {diff}"
0 commit comments