Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed Aug 26, 2024
1 parent 4b7967e commit 7eb8ad2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module MethodImplAttribute =
compilation
|> withLangVersion80
|> typecheck
|> withSingleDiagnostic (Warning 3151, Line 2, Col 1, Line 3, Col 38, "This member, function or value declaration may not be declared 'inline'")
|> withSingleDiagnostic (Warning 3151, Line 3, Col 12, Line 3, Col 19, "This member, function or value declaration may not be declared 'inline'")

[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"MethodImplAttribute.NoInlining_InlineKeyword.fs"|])>]
let ``NoInlining_fs with inline keyword => should not warn in F# 7 or older`` compilation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ let (|OddVOption|_|) x = if x % 2 = 1 then ValueSome() else ValueNone
|> typecheck
|> shouldFail
|> withDiagnostics [
(Error 3350, Line 1, Col 5, Line 1, Col 20, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.")
(Error 3350, Line 2, Col 5, Line 2, Col 23, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.")
(Error 3350, Line 1, Col 6, Line 1, Col 17, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.")
(Error 3350, Line 2, Col 6, Line 2, Col 20, "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.")
]

[<Fact>]
Expand Down
10 changes: 5 additions & 5 deletions tests/fsharp/Compiler/Language/StructActivePatternTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ match ret_attrs, binding_attrs with
[<return:Struct>]
let (|Foo|_|) x = ValueNone
"""
[|(FSharpDiagnosticSeverity.Error, 3350, (2, 1, 3, 16),
[|(FSharpDiagnosticSeverity.Error, 3350, (3, 6, 3, 13),
"Feature 'struct representation for active patterns' is not available in F# 5.0. Please use language version 6.0 or greater.")|]

[<Test>]
Expand All @@ -179,7 +179,7 @@ let (|Foo|_|) x = ValueNone
"""
[|(FSharpDiagnosticSeverity.Error, 842, (2, 3, 2, 9),
"This attribute is not valid for use on this language element");
(FSharpDiagnosticSeverity.Error, 3350, (2, 1, 3, 16),
(FSharpDiagnosticSeverity.Error, 3350, (3, 6, 3, 13),
"Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.")|]

[<Test>]
Expand All @@ -195,10 +195,10 @@ let f x = x
[<return:Struct>]
let (|A|B|) x = A
"""
[|(FSharpDiagnosticSeverity.Error, 3385, (2, 1, 3, 6),
[|(FSharpDiagnosticSeverity.Error, 3385, (3, 5, 3, 6),
"The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions")
(FSharpDiagnosticSeverity.Error, 3385, (5, 1, 6, 8),
(FSharpDiagnosticSeverity.Error, 3385, (6, 5, 6, 6),
"The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions")
(FSharpDiagnosticSeverity.Error, 3385, (8, 1, 9, 14),
(FSharpDiagnosticSeverity.Error, 3385, (9, 6, 9, 11),
"The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions")|]

0 comments on commit 7eb8ad2

Please sign in to comment.