From 0177e2f19d8df90f90aea5391e5aa0c0942b92e4 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Thu, 24 Jul 2025 16:53:57 -0700 Subject: [PATCH] Improve composability of verifyBaseline/verifyILBaseline --- .../CompilerDirectives/Nowarn.fs | 2 +- .../MethodResolution/MethodResolution.fs | 1 + .../OffsideExceptions/OffsideExceptions.fs | 2 +- .../ConstraintSolver/PrimitiveConstraints.fs | 1 + .../AsyncExpressionStepping.fs | 1 + .../AttributeTargets/AttributeTargets.fs | 1 + .../CCtorDUWithMember/CCtorDUWithMember.fs | 8 +- .../CompiledNameAttribute.fs | 2 + .../ComputationExpressions.fs | 2 + .../ComputedCollections.fs | 1 + .../DoNotBoxStruct/DoNotBoxStruct.fs | 1 + .../EmittedIL/ForLoop/ForLoop.fs | 5 + .../GeneratedIterators/GeneratedIterators.fs | 1 + .../GenericComparison/GenericComparison.fs | 1 + .../InequalityComparison.fs | 1 + .../EmittedIL/Inlining/Inlining.fs | 2 + .../ListExpressionStepping.fs | 1 + .../MethodImplAttribute.fs | 1 + .../EmittedIL/Misc/Misc.fs | 1 + .../EmittedIL/Nullness/NullnessMetadata.fs | 5 +- .../QueryExpressionStepping.fs | 1 + .../ClassTypeVisibility.fs | 28 +-- .../ClassTypeVisibilityModuleRoot.fs | 28 +-- .../ClassTypeVisibilityModuleRootWithFsi.fs | 28 +-- .../ClassTypeVisibilityNamespaceRoot.fs | 28 +-- ...ClassTypeVisibilityNamespaceRootWithFsi.fs | 32 +-- .../SeqExpressionStepping.fs | 1 + .../SeqExpressionTailCalls.fs | 1 + .../SerializableAttribute.fs | 1 + .../EmittedIL/StaticInit/StaticInit.fs | 1 + .../StaticOptimizations.fs | 1 + .../EmittedIL/SteppingMatch/SteppingMatch.fs | 1 + .../EmittedIL/Structure/Structure.fs | 1 + .../EmittedIL/TestFunctions/TestFunctions.fs | 3 +- .../EmittedIL/TryCatch/TryCatch.fs | 1 + .../EmittedIL/Tuples/Tuples.fs | 1 + .../EmittedIL/operators/Operators.fs | 1 + .../Nullness/NullableRegressionTests.fs | 13 +- .../TypeChecks/PropertyShadowingTests.fs | 10 +- tests/FSharp.Test.Utilities/Compiler.fs | 206 ++++++++++++------ 40 files changed, 276 insertions(+), 151 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs index 4eeccde4602..5349708ff9b 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs @@ -113,7 +113,7 @@ module Nowarn = || (List.zip expected actual |> List.exists(fun((error, line), d) -> error <> d.Error || line <> d.Range.StartLine)) let private withDiags testId langVersion flags (sources: SourceCodeFileKind list) (expected: (ErrorType * int) list) (result: CompilationResult) = - let actual = result.Output.Diagnostics + let actual = result.Output.Diagnostics |> List.distinctBy (fun ei -> ei.Range.StartLine, ei.Range.StartColumn, ei.Range.EndLine, ei.Range.EndColumn, ei.Message) if testFailed expected actual then let sb = new StringBuilder() let print (s: string) = sb.AppendLine s |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution/MethodResolution.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution/MethodResolution.fs index 74713d082ac..f20dee63d01 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution/MethodResolution.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution/MethodResolution.fs @@ -39,6 +39,7 @@ if returnvalue2<> true && value2 <> 7 then compilation |> getCompilation |> ignoreWarnings + |> compile |> verifyILBaseline [] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs index 2be0b9897db..c52e47a5849 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs @@ -38,8 +38,8 @@ module OffsideExceptions = |> getCompilation |> asFsx |> withLangVersion60 + |> typecheck |> verifyBaseline - |> ignore [] let RelaxWhitespace2_Indentation() = diff --git a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/PrimitiveConstraints.fs b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/PrimitiveConstraints.fs index 24f3b6250c8..21db1da0ab6 100644 --- a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/PrimitiveConstraints.fs +++ b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/PrimitiveConstraints.fs @@ -17,6 +17,7 @@ module PrimitiveConstraints = let ``Invalid object constructor`` compilation = // Regression test for FSharp1.0:4189 compilation |> getCompilation + |> typecheck |> verifyBaseline [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionStepping.fs index 70515578357..52ce2daf4ac 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionStepping.fs @@ -14,6 +14,7 @@ module AsyncExpressionStepping = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyBaseline |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AttributeTargets/AttributeTargets.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AttributeTargets/AttributeTargets.fs index 31831155036..3ae6a112039 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AttributeTargets/AttributeTargets.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AttributeTargets/AttributeTargets.fs @@ -14,6 +14,7 @@ module AttributeTargets = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyBaseline |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember.fs index 3c496e7dfbb..89345a07f42 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember.fs @@ -9,11 +9,13 @@ module CCtorDUWithMember = let verifyCompilation compilation = compilation |> withOptions [ "--test:EmitFeeFeeAs100001" ] + |> withNoWarn 988 |> asExe |> withNoOptimize |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyBaseline |> verifyILBaseline @@ -71,7 +73,7 @@ type ILArrayShape = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ """ .method public hidebysig instance bool Equals(class RealInternalSignature.ILArrayShape obj, @@ -97,7 +99,7 @@ type ILArrayShape = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ """ .method public hidebysig instance bool Equals(class RealInternalSignature.ILArrayShape obj, @@ -125,7 +127,7 @@ Module.publicFunction () |> printfn "%b" |> asExe |> withRealInternalSignature realSig |> compileAndRun - |> withILContains [ + |> verifyILContains [ $$""" .method {{expected}} hidebysig instance bool Equals(class RealInternalSignature/Module/DU obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute.fs index 12dadfdb824..8bab5b4ebf6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute.fs @@ -10,11 +10,13 @@ module CompiledNameAttribute = compilation |> asFs |> withOptions [ "--test:EmitFeeFeeAs100001" ] + |> withNoWarn 988 |> asExe |> withNoOptimize |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyBaseline |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs index 3fe71d27ac6..f4fefd871a3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs @@ -30,6 +30,7 @@ module ComputationExpressions = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> typecheck |> verifyILBaseline [] @@ -85,4 +86,5 @@ module ComputationExpressions = ] |> withEmbeddedPdb |> withEmbedAllSource + |> typecheck |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs index 49db6354ad8..828a92e2953 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs @@ -11,6 +11,7 @@ module ComputedCollections = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs index 7fc56dba8c1..1464f865eec 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs @@ -24,6 +24,7 @@ module DoNotBoxStruct = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline //SOURCE=DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.exe" # DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs index a12316477a9..c7b13a4e60a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs @@ -13,7 +13,12 @@ module ForLoop = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*.exe Verified." + ] // SOURCE=ForLoop01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop01.exe" # ForLoop01.fs - [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs index 244318ddf9b..5035e37c1b7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GeneratedIterators/GeneratedIterators.fs @@ -14,6 +14,7 @@ module GeneratedIterators = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=GenIter01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd GenIter01.exe" # GenIter01.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs index a17856a7da3..be9ecfff785 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs @@ -14,6 +14,7 @@ module GenericComparison = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=Compare01.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Compare01.dll" # Compare01.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison.fs index 03c94f28b5d..9e123448407 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison.fs @@ -14,6 +14,7 @@ module InequalityComparison = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=InequalityComparison01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd InequalityComparison01.exe" # x <= y diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs index 109b427ad5f..ffd75e0d081 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs @@ -14,6 +14,7 @@ module Inlining = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline let withRealInternalSignature realSig compilation = @@ -50,6 +51,7 @@ module Inlining = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs index 120d3a2ffd4..79a348e1e26 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs @@ -14,6 +14,7 @@ module ListExpressionStepping = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=ListExpressionSteppingTest1.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ListExpressionSteppingTest1.exe" # ListExpressionSteppingTest1.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs index 9f3b2db8e02..adbf38b92d6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs @@ -14,6 +14,7 @@ module MethodImplAttribute = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=MethodImplAttribute.ForwardRef.fs SCFLAGS="-a -g --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplAttribute.ForwardRef.dll" # MethodImplAttribute.ForwardRef.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs index 4e759a26c95..c21c35496f3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs @@ -14,6 +14,7 @@ module Misc = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=AbstractClass.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AbstractClass.exe" # AbstractClass.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs index e517c97f507..e4d4243b300 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs @@ -20,7 +20,8 @@ module NullnessMetadata = let verifyCompilation (o:Optimize) compilation = compilation - |> addOptions o + |> addOptions o + |> compile |> verifyILBaseline [] @@ -134,7 +135,7 @@ module NullnessMetadata = |> withNoWarn 52 |> addOptions DoNotOptimize |> compile - |> withILContains + |> verifyILContains [".method public hidebysig virtual instance string ToString() cil managed" ".method public hidebysig virtual instance int32 GetHashCode() cil managed" "hidebysig virtual instance bool Equals(object obj) cil managed" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/QueryExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/QueryExpressionStepping.fs index bc205b74721..9d62c5feb9b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/QueryExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/QueryExpressionStepping.fs @@ -21,6 +21,7 @@ module QueryExpressionStepping = |> withEmbedAllSource |> withReferences [utilsLibrary] |> ignoreWarnings + |> typecheck |> verifyILBaseline // SOURCE=Linq101Aggregates01.fs SCFLAGS="-r:Utils.dll -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Linq101Aggregates01.exe" # Linq101Aggregates01.fs - CodeGen diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibility.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibility.fs index cb0e4d3168e..1fe0838c9cc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibility.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibility.fs @@ -27,7 +27,7 @@ type public TypeFour () = class end |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ """ .class auto ansi serializable nested public TypeOne extends [runtime]System.Object { @@ -74,7 +74,7 @@ type private TypeFour () = class end |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then //type private TypeOne public () = class end """.class auto ansi serializable nested private TypeOne @@ -161,7 +161,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig instance void @@ -250,7 +250,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig instance void @@ -339,7 +339,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig specialname @@ -564,7 +564,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig specialname @@ -797,7 +797,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig specialname @@ -1238,7 +1238,7 @@ type private TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method assembly hidebysig specialname @@ -1671,7 +1671,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig instance void @@ -1760,7 +1760,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig instance void @@ -1848,7 +1848,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .me thod public specialname static int32 @@ -2184,7 +2184,7 @@ type private TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig specialname @@ -2417,7 +2417,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method public hidebysig specialname @@ -2858,7 +2858,7 @@ type private TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .method assembly hidebysig specialname diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs index a7ba195e02f..ad1b5e11c16 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs @@ -32,7 +32,7 @@ type public TypeFour () = class end |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeConstructors.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then """ .class auto ansi serializable nested public TypeOne extends [runtime]System.Object @@ -104,7 +104,7 @@ type private TypeFour () = class end""" |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeConstructors.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then """ .class auto ansi serializable nested private TypeOne @@ -272,7 +272,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeInstanceMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -308,7 +308,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -345,7 +345,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeInstanceProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -390,7 +390,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -443,7 +443,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeInstanceMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" ".method assembly hidebysig specialname instance void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -527,7 +527,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" ".method assembly hidebysig specialname instance void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -604,7 +604,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeStaticMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -641,7 +641,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeStaticMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -676,7 +676,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeStaticProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -719,7 +719,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeStaticProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -771,7 +771,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeStaticMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -856,7 +856,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeStaticMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs index ba40e165155..75b81be40d3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRootWithFsi.fs @@ -35,7 +35,7 @@ type HiddenType () = class end |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .class auto ansi serializable nested public TypeOne @@ -253,7 +253,7 @@ type HiddenType () = class end |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .class auto ansi serializable nested private TypeOne @@ -461,7 +461,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -502,7 +502,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -545,7 +545,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -597,7 +597,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -676,7 +676,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" ".method assembly hidebysig specialname instance void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -783,7 +783,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" ".method assembly hidebysig specialname instance void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -862,7 +862,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -896,7 +896,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -940,7 +940,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -995,7 +995,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -1071,7 +1071,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -1180,7 +1180,7 @@ type private TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs index bfddf645779..420da9490c1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs @@ -32,7 +32,7 @@ type public TypeFour () = class end |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeConstructors.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then """ .class public auto ansi serializable RealInternalSignature.TypeOne @@ -202,7 +202,7 @@ type private TypeFour () = class end |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeConstructors.dll Verified." ] - |> withILContains [ + |> verifyILContains [ """ .class private auto ansi serializable RealInternalSignature.TypeOne extends [runtime]System.Object @@ -300,7 +300,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeInstanceMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -336,7 +336,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -373,7 +373,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -418,7 +418,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -471,7 +471,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeInstanceMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname rtspecialname instance void .ctor() cil managed" ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" @@ -558,7 +558,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeInstanceMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" ".method assembly hidebysig specialname instance void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -634,7 +634,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeStaticMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -670,7 +670,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeStaticMethods.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -706,7 +706,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeStaticProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -750,7 +750,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeStaticProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -803,7 +803,7 @@ type public TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PublicTypeStatiMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -888,7 +888,7 @@ type private TestType () = |> withOutputContainsAllInOrderWithWildcards [ "All Classes and Methods in*PrivateTypeStatiMixedProperties.dll Verified." ] - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRootWithFsi.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRootWithFsi.fs index 39e9658c226..f6a70f9c71d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRootWithFsi.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRootWithFsi.fs @@ -35,7 +35,7 @@ type HiddenType () = class end |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then """ .class public auto ansi serializable RealInternalSignature.TypeOne @@ -244,7 +244,7 @@ type HiddenType () = class end |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ """ .class private auto ansi serializable RealInternalSignature.TypeOne extends [runtime]System.Object @@ -362,7 +362,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -404,7 +404,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" ".method assembly hidebysig instance void InternalMethod() cil managed" @@ -450,7 +450,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -506,7 +506,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" ".method public hidebysig specialname instance void set_PublicProperty(int32 v) cil managed" @@ -585,7 +585,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname rtspecialname instance void .ctor() cil managed" ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" @@ -694,7 +694,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" ".method assembly hidebysig specialname instance void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -773,7 +773,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -807,7 +807,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -851,7 +851,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -907,7 +907,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" ".method public specialname static void set_PublicProperty(int32 v) cil managed" @@ -987,7 +987,7 @@ type public TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -1096,7 +1096,7 @@ type private TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" ".method assembly specialname static void set_MixedPropertyOne(int32 _arg1) cil managed" @@ -1174,7 +1174,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -1218,7 +1218,7 @@ type TestType () = |> asLibrary |> withRealInternalSignature realSig |> compile - |> withILContains [ + |> verifyILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs index 01971f4d183..bb6e4c88c3c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs @@ -15,6 +15,7 @@ module SeqExpressionStepping = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline //Retry SOURCE=SeqExpressionSteppingTest01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd SeqExpressionSteppingTest1.exe" # SeqExpressionSteppingTest1.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionTailCalls/SeqExpressionTailCalls.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionTailCalls/SeqExpressionTailCalls.fs index b9fc3e0a54a..6240be40ca5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionTailCalls/SeqExpressionTailCalls.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionTailCalls/SeqExpressionTailCalls.fs @@ -16,6 +16,7 @@ module SeqExpressionTailCalls = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=SeqExpressionTailCalls01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd SeqExpressionTailCalls01.exe" # SeqExpressionTailCalls01.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs index 9e4053528bc..22becacebf8 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs @@ -15,6 +15,7 @@ module SerializableAttribute = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=ToplevelModule.fs SCFLAGS="-a -g --out:TopLevelModule.dll --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ToplevelModule.dll" # ToplevelModule.fs - Desktop diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit.fs index 6b12f4a145b..490512058e3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit.fs @@ -15,6 +15,7 @@ module StaticInit = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=LetBinding01.fs SCFLAGS=" -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LetBinding01.exe" # LetBinding01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs index d1099c27c20..d4d582bb2dd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs @@ -11,6 +11,7 @@ module StaticOptimizations = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch.fs index d1298a98d40..cc5de8c7890 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch.fs @@ -15,6 +15,7 @@ module SteppingMatch = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs index 264f10eaba1..cef637ee350 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs @@ -39,6 +39,7 @@ module Structure = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs index 4390225b850..44a169604be 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs @@ -18,12 +18,13 @@ module TestFunctions = let verifyCompileAndRun compilation = compilation |> verifyCore - |> verifyILBaseline |> compileAndRun + |> verifyILBaseline let verifyCompilation compilation = compilation |> verifyCore + |> compile |> verifyILBaseline //SOURCE=TestFunction01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction01.exe" # TestFunction01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs index e40fd039fe0..bc3efb3cae2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs @@ -21,6 +21,7 @@ module TryCatch = let verifyCompilation compilation = setupCompilation compilation + |> compile |> verifyILBaseline [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/Tuples.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/Tuples.fs index 97d84b94d52..483e2709317 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/Tuples.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/Tuples.fs @@ -15,6 +15,7 @@ module Tuples = |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings + |> compile |> verifyILBaseline // SOURCE=Tuple01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Tuple01.exe" # Tuple01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/operators/Operators.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/operators/Operators.fs index 463bf57950e..e75d24736d4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/operators/Operators.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/operators/Operators.fs @@ -13,4 +13,5 @@ module Operators = |> getCompilation |> asExe |> ignoreWarnings + |> compile |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs index 486b68c7d2b..7698f34fbbf 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs @@ -73,66 +73,77 @@ let ``Signature conformance`` langVersion checknulls = let ``Existing positive v8 disabled`` compilation = compilation |> withVersionAndCheckNulls ("8.0",false) + |> typecheck |> verifyBaseline [] let ``Existing positive vPreview disabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",false) + |> typecheck |> verifyBaseline [] let ``Existing positive vPreview enabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",true) + |> typecheck |> verifyBaseline [] let ``Existing negative v8 disabled`` compilation = compilation |> withVersionAndCheckNulls ("8.0",false) + |> typecheck |> verifyBaseline [] let ``Existing negative vPreview disabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",false) + |> typecheck |> verifyBaseline [] let ``Existing negative vPreview enabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",true) + |> typecheck |> verifyBaseline [] let ``Library functions nullness disabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",false) + |> typecheck |> verifyBaseline [] let ``Library functions nullness enabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",true) + |> typecheck |> verifyBaseline [] let ``With new nullness syntax nullness disabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",false) + |> typecheck |> verifyBaseline [] let ``DefaultValueBug when checknulls is disabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",false) + |> typecheck |> verifyBaseline [] let ``With new nullness syntax nullness enabled`` compilation = compilation |> withVersionAndCheckNulls ("preview",true) + |> typecheck |> verifyBaseline // https://github.com/dotnet/fsharp/issues/18288 @@ -160,8 +171,6 @@ let ``Inference problem limit regression v8`` compilation = |> typecheck |> shouldSucceed - - [] [] [] diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/PropertyShadowingTests.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/PropertyShadowingTests.fs index c7cbece80e8..2ef801abc51 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/PropertyShadowingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/PropertyShadowingTests.fs @@ -25,8 +25,8 @@ module PropertyShadowingTests = |> asFsx |> withNoDebug |> withRealInternalSignatureOff - |> verifyBaselines |> compileAndRun + |> verifyBaselines |> shouldSucceed [ asFsx |> withNoDebug |> withRealInternalSignatureOn - |> verifyBaselines |> compileAndRun + |> verifyBaselines |> shouldSucceed @@ -70,8 +70,8 @@ module PropertyShadowingTests = |> asFsx |> withNoDebug |> withOptions ["--langversion:7.0"] + |> typecheck |> verifyBaselines - |> compile |> shouldFail [ asFsx |> withNoDebug + |> typecheck |> verifyBaselines - |> compile |> shouldFail @@ -110,6 +110,6 @@ module PropertyShadowingTests = |> asFsx |> withNoDebug |> withOptions ["--langversion:7.0"] + |> typecheck |> verifyBaselines - |> compile |> shouldFail diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index d3ee5394866..2d0695c7369 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -417,9 +417,13 @@ module rec Compiler = errors |> List.ofArray - |> List.distinctBy (fun e -> e.FileName,e.Severity, e.ErrorNumber, e.StartLine, e.StartColumn, e.EndLine, e.EndColumn, e.Message) |> List.map toErrorInfo + let private fromFSharpDiagnosticDistinct (errors: ErrorInfo[]) : (SourceCodeFileName * ErrorInfo) list = + let errors = fromFSharpDiagnosticDistinct errors + errors + |> List.distinctBy (fun (name, ei) -> name, ei.NativeRange.Start, ei.NativeRange.StartColumn, ei.NativeRange.End, ei.NativeRange.EndColumn, ei.Message) + let private partitionErrors diagnostics = diagnostics |> List.partition (fun e -> match e.Error with Error _ -> true | _ -> false) let private getErrors diagnostics = diagnostics |> List.filter (fun e -> match e.Error with Error _ -> true | _ -> false) @@ -773,9 +777,13 @@ module rec Compiler = withOptionsHelper [ $"--preferreduilang:%s{culture}" ] "preferreduilang is only supported for F#" cUnit let rec private asMetadataReference (cUnit: CompilationUnit) reference = + let ignoreWarnings = + match cUnit with + | FS fs -> fs.IgnoreWarnings + | _ -> false match reference with | CompilationReference (cmpl, _) -> - let result = compileFSharpCompilation cmpl false cUnit + let result = compileFSharpCompilation cmpl ignoreWarnings cUnit match result with | CompilationResult.Failure f -> let message = sprintf "Operation failed (expected to succeed).\n All errors:\n%A" (f.Diagnostics) @@ -1264,39 +1272,81 @@ Actual: file.SetLength(0) file.WriteAllText(actualErrors) - let private verifyFSBaseline fs : unit = - match fs.Baseline with - | None -> failwith "Baseline was not provided." - | Some bsl -> - let errorsExpectedBaseLine = - match bsl.FSBaseline.Content with - | Some b -> b.Replace("\r\n","\n") - | None -> String.Empty - - let typecheckDiagnostics = fs |> typecheckFSharpSourceAndReturnErrors - - let errorsActual = - (typecheckDiagnostics - |> Array.map (sprintf "%A") - |> String.concat "\n" - ).Replace("\r\n","\n") - - if errorsExpectedBaseLine <> errorsActual then - fs.CreateOutputDirectory() - createBaselineErrors bsl.FSBaseline errorsActual - updateBaseLineIfEnvironmentSaysSo bsl.FSBaseline - let errorMsg = (convenienceBaselineInstructions bsl.FSBaseline errorsExpectedBaseLine errorsActual) - Assert.True((errorsExpectedBaseLine = errorsActual), errorMsg) - elif FileSystem.FileExistsShim(bsl.FSBaseline.FilePath) then - FileSystem.FileDeleteShim(bsl.FSBaseline.FilePath) - - /// Check the typechecker output against the baseline, if invoked with empty baseline, will expect no error/warnings output. - let verifyBaseline (cUnit: CompilationUnit) : CompilationUnit = - match cUnit with - | FS fs -> (verifyFSBaseline fs) |> ignore - | _ -> failwith "Baseline tests are only supported for F#." - - cUnit + /// Turn our ErrorInfo back into a genuine FSharpDiagnostic + let private toFSharpDiagnostic (ei: ErrorInfo) : FSharpDiagnostic = + + // extract severity and error number + let (severity, code) = + match ei.Error with + | Error n -> FSharpDiagnosticSeverity.Error, n + | Warning n -> FSharpDiagnosticSeverity.Warning, n + | Information n -> FSharpDiagnosticSeverity.Info, n + | Hidden n -> FSharpDiagnosticSeverity.Hidden, n + + // Create exactly the diagnostic the compiler would have produced + FSharpDiagnostic.Create( + severity, + ei.Message, + code, + ei.NativeRange, + ei.SubCategory + ) + + let formatDiagnostic (diag: FSharpDiagnostic) : string = + let filename = System.IO.Path.GetFileName diag.FileName + let range = diag.Range + let severity = + match diag.Severity with + | FSharpDiagnosticSeverity.Error -> "error" + | FSharpDiagnosticSeverity.Warning -> "warning" + | FSharpDiagnosticSeverity.Info -> "info" + | FSharpDiagnosticSeverity.Hidden -> "hidden" + + // produce familiar compiler-style output + $"{filename} ({range.StartLine},{range.StartColumn + 1})-({range.EndLine},{range.EndColumn + 1}) {diag.Subcategory} {severity} {diag.Message}" + + /// After compile, rebuild and print FSharpDiagnostic[] exactly as before, + /// then diff against your existing .err.bsl files (few lines will shift). + let verifyBaseline (cResult: CompilationResult) : CompilationResult = + // 1) Grab the ErrorInfo list from the compile result… + let errorInfos = + match cResult with + | CompilationResult.Success o + | CompilationResult.Failure o -> o.Diagnostics + + // 2) Convert to FSharpDiagnostic[] and format with "%A" + let formattedActual = + errorInfos + |> List.map toFSharpDiagnostic + |> List.toArray + |> Array.map formatDiagnostic + |> String.concat "\n" + |> normalizeNewlines + + // 3) Load the old baseline text + let fsSource = + match cResult with + | CompilationResult.Success o + | CompilationResult.Failure o -> + match o.Compilation with + | FS fs -> fs + | _ -> failwith "verifyBaseline only supports F#" + let expected = + fsSource.Baseline.Value.FSBaseline.Content + |> Option.defaultValue "" + |> normalizeNewlines + + // 4) Compare or update + if expected <> formattedActual then + // same update mechanism you already have: + fsSource.CreateOutputDirectory() + createBaselineErrors fsSource.Baseline.Value.FSBaseline formattedActual + updateBaseLineIfEnvironmentSaysSo fsSource.Baseline.Value.FSBaseline + let msg = convenienceBaselineInstructions fsSource.Baseline.Value.FSBaseline expected formattedActual + Assert.True(false, msg) + + // 5) Return the original result for fluent chaining + cResult let private doILCheck func (il: string list) result = match result with @@ -1306,7 +1356,7 @@ Actual: | Some p -> func p il | CompilationResult.Failure f -> failwith $"Result should be \"Success\" in order to get IL. Failure: {Environment.NewLine}{f}" - let withILContains expected result : CompilationResult = + let verifyILContains expected result : CompilationResult = match result with | CompilationResult.Success s -> match s.OutputPath with @@ -1346,26 +1396,22 @@ Actual: let errorMsg = (convenienceBaselineInstructions baseline.ILBaseline expectedIL actualIL) + errorMsg Assert.Fail(errorMsg) - let verifyILBaseline (cUnit: CompilationUnit) : CompilationUnit = - match cUnit with - | FS fs -> - match fs |> compileFSharp, fs.Baseline with - | CompilationResult.Failure a, Some baseline -> - match baseline.ILBaseline.Content with - | Some "" -> () - | Some il -> - failwith $"Build failure: {a} while expected il\n{il}" + let verifyILBaseline (compilationResult: CompilationResult) : CompilationResult = + match compilationResult with + | CompilationResult.Success output -> + match output.Compilation with + | FS fs -> + match fs.Baseline with + | Some baseline -> + verifyFSILBaseline baseline output + compilationResult | None -> - if not (FileSystem.FileExistsShim baseline.ILBaseline.BslSource) && updateBaseline () then - File.WriteAllText(baseline.ILBaseline.BslSource, "") - else - failwith $"Build failure empty baseline at {baseline.ILBaseline.BslSource}: {a}" - | CompilationResult.Success s, Some baseline -> verifyFSILBaseline baseline s - | _, None -> - failwithf $"Baseline was not provided." - | _ -> failwith "Baseline tests are only supported for F#." - - cUnit + failwith "verifyILBaselineResult: No baseline attached to the F# source." + | _ -> failwith "verifyILBaselineResult: Only F# CompilationResult supported." + | CompilationResult.Failure f -> + match f.Compilation with + | FS _ -> compilationResult + | _ -> failwith "verifyILBaselineResult: Only F# CompilationResult supported." let verifyBaselines = verifyBaseline >> verifyILBaseline @@ -1618,7 +1664,7 @@ Actual: let expectedErrors = expected |> List.map (fun error -> errorMessage error) let expectedErrorsAsStr = expectedErrors |> String.concat ";\n" |> sprintf "[%s]" - let sourceErrors = source |> List.map (fun error -> errorMessage { error with Range = adjustRange error.Range libAdjust }) + let sourceErrors = source |> List.distinctBy (fun ei -> ei.Range.StartLine, ei.Range.StartColumn, ei.Range.EndLine, ei.Range.EndColumn, ei.Message) |> List.map (fun error -> errorMessage { error with Range = adjustRange error.Range libAdjust }) let sourceErrorsAsStr = sourceErrors |> String.concat ";\n" |> sprintf "[%s]" let inline checkEqual k a b = @@ -1871,9 +1917,13 @@ Actual: | _ -> failwith "Cannot check exit code on this run result." result - let private getMatch (input: string) (pattern: string) useWildcards= + [] + type MatchStyle = | Standard | Wildcards | RegexPatterns + + let private getMatch (input: string) (pattern: string) (matchStyle: MatchStyle) = // Escape special characters and replace wildcards with regex equivalents - if useWildcards then + match matchStyle with + | MatchStyle.Wildcards -> let input = input.Replace("\r\n", "\n") let pattern = $"""^{Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")}$""" let m = Regex(pattern, RegexOptions.Multiline).Match(input) @@ -1881,10 +1931,17 @@ Actual: m.Index else -1 - else - input.IndexOf(pattern) + | MatchStyle.RegexPatterns -> + let input = input.Replace("\r\n", "\n") + let m = Regex(pattern, RegexOptions.Multiline).Match(input) + if m.Success then + m.Index + else + -1 + | MatchStyle.Standard -> + input.IndexOf(pattern) - let private checkOutputInOrderCore useWildcards (category: string) (substrings: string list) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = + let private checkOutputInOrderCore matchStyle (category: string) (substrings: string list) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = match result.RunOutput with | None -> printfn "Execution output is missing cannot check \"%A\"" category @@ -1895,14 +1952,17 @@ Actual: let input = selector e let mutable searchPos = 0 for substring in substrings do - match getMatch (input.Substring(searchPos)) substring useWildcards with + match getMatch (input.Substring(searchPos)) substring matchStyle with | -1 -> failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category input) | pos -> searchPos <- pos + substring.Length | _ -> failwith "Cannot check output on this run result." result + let private checkMatchedOutputInOrder matchStyle category substrings selector result = + checkOutputInOrderCore matchStyle category substrings selector result + let private checkOutputInOrder category substrings selector result = - checkOutputInOrderCore false category substrings selector result + checkMatchedOutputInOrder MatchStyle.Standard category substrings selector result let withOutputContainsAllInOrder (substrings: string list) (result: CompilationResult) : CompilationResult = checkOutputInOrder "STDERR/STDOUT" substrings (fun o -> o.StdOut + "\n" + o.StdErr) result @@ -1920,7 +1980,10 @@ Actual: checkOutputInOrder "STDERR" [substring] (fun o -> o.StdErr) result let private checkOutputInOrderWithWildcards category substrings selector result = - checkOutputInOrderCore true category substrings selector result + checkOutputInOrderCore MatchStyle.Wildcards category substrings selector result + + let private checkOutputInOrderWithRegexPatterns category substrings selector result = + checkOutputInOrderCore MatchStyle.RegexPatterns category substrings selector result let withOutputContainsAllInOrderWithWildcards (substrings: string list) (result: CompilationResult) : CompilationResult = checkOutputInOrderWithWildcards "STDERR/STDOUT" substrings (fun o -> o.StdOut + "\n" + o.StdErr) result @@ -1937,6 +2000,21 @@ Actual: let withStdErrContainsWithWildcards (substring: string) (result: CompilationResult) : CompilationResult = checkOutputInOrderWithWildcards "STDERR" [substring] (fun o -> o.StdErr) result + let withOutputContainsAllInOrderWithRegexPatterns (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithRegexPatterns "STDERR/STDOUT" substrings (fun o -> o.StdOut + "\n" + o.StdErr) result + + let withStdOutContainsWithRegexPatterns (substring: string) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithRegexPatterns "STDOUT" [substring] (fun o -> o.StdOut) result + + let withStdOutContainsAllInOrderWithRegexPatterns (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithRegexPatterns "STDOUT" substrings (fun o -> o.StdOut) result + + let withStdErrContainsAllInOrderWithRegexPatterns (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithRegexPatterns "STDERR" substrings (fun o -> o.StdErr) result + + let withStdErrContainsWithRegexPatterns (substring: string) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithRegexPatterns "STDERR" [substring] (fun o -> o.StdErr) result + let private assertEvalOutput (selector: FsiValue -> 'T) (value: 'T) (result: CompilationResult) : CompilationResult = match result.RunOutput with | None -> failwith "Execution output is missing cannot check value."