Skip to content

Commit 753cb84

Browse files
authored
Reenable a bunch of tests (#18991)
1 parent 584c702 commit 753cb84

File tree

17 files changed

+192
-125
lines changed

17 files changed

+192
-125
lines changed

tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ module TestFrameworkAdapter =
172172
let singleTestBuildAndRunIsolated folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest ScriptSessionIsolation.Isolated
173173

174174
let singleVersionedNegTestAux folder bonusArgs version testName =
175-
singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version
175+
singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version ScriptSessionIsolation.Shared
176176
let singleVersionedNegTest (folder:string) (version:LangVersion) (testName:string) =
177177
singleVersionedNegTestAux folder [] version testName
178178
let singleNegTest folder testName = singleVersionedNegTest folder LangVersion.Latest testName

tests/FSharp.Test.Utilities/Compiler.fs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,15 +1833,18 @@ Actual:
18331833
let expectedContent = File.ReadAllText(path) |> normalizeNewLines
18341834
let actualErrors = renderToString result
18351835

1836-
match Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") with
1837-
| null -> ()
1838-
| _ when expectedContent = actualErrors -> ()
1839-
| _ -> File.WriteAllText(path, actualErrors)
1840-
//File.WriteAllText(path, actualErrors)
1841-
18421836
match Assert.shouldBeSameMultilineStringSets expectedContent actualErrors with
18431837
| None -> ()
1844-
| Some diff -> Assert.True(String.IsNullOrEmpty(diff), path)
1838+
| Some diff ->
1839+
if Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") <> null then
1840+
File.WriteAllText(path, actualErrors)
1841+
1842+
printfn $"{Path.GetFullPath path} \n {diff}"
1843+
printfn "==========================EXPECTED==========================="
1844+
printfn "%s" expectedContent
1845+
printfn "===========================ACTUAL============================"
1846+
printfn "%s" actualErrors
1847+
Assert.True(String.IsNullOrEmpty(diff), path)
18451848

18461849
result
18471850

tests/fsharp/typecheck/sigs/neg04.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ neg04.fs(159,47,159,57): typecheck error FS0692: This function value is being us
128128

129129
neg04.fs(163,54,163,67): typecheck error FS0692: This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking 1 arguments.
130130

131-
neg04.fs(178,13,178,18): typecheck error FS0001: The type '('a -> unit)' does not support the 'equality' constraint because it is a function type
131+
neg04.fs(178,13,178,18): typecheck error FS0001: The type ''a -> unit' does not support the 'equality' constraint because it is a function type

tests/fsharp/typecheck/sigs/neg05.bsl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,25 @@ neg05.fs(57,15,57,18): typecheck error FS1198: The generic member 'Pop' has been
2424
neg05.fs(51,11,51,13): typecheck error FS0663: This type parameter has been used in a way that constrains it to always be 'unit'
2525

2626
neg05.fs(51,11,51,13): typecheck error FS0660: This code is less generic than required by its annotations because the explicit type variable 'a' could not be generalized. It was constrained to be 'unit'.
27+
28+
neg05.fs(12,3,12,9): typecheck error FS0842: This attribute cannot be applied to interface. Valid targets are: class, struct, parameter, return value
29+
30+
neg05.fs(14,5,15,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition
31+
32+
neg05.fs(17,3,17,8): typecheck error FS0842: This attribute cannot be applied to interface. Valid targets are: class
33+
34+
neg05.fs(19,5,20,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition
35+
36+
neg05.fs(24,5,25,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition
37+
38+
neg05.fs(27,3,27,12): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: interface
39+
40+
neg05.fs(29,5,30,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition
41+
42+
neg05.fs(32,3,32,8): typecheck error FS0842: This attribute cannot be applied to struct. Valid targets are: class
43+
44+
neg05.fs(34,5,35,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition
45+
46+
neg05.fs(37,3,37,12): typecheck error FS0842: This attribute cannot be applied to struct. Valid targets are: interface
47+
48+
neg05.fs(39,5,40,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition

tests/fsharp/typecheck/sigs/neg07.bsl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.
3-
41
neg07.fs(24,13,24,23): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined. Maybe you want one of the following:
52
X.UnionCase1
63

tests/fsharp/typecheck/sigs/neg113.bsl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have
55

66
neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion
77

8-
neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type
8+
neg113.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type
99
'{| b: int |}'
1010
is not compatible with type
1111
'{| a: int |}'
1212

1313

1414
neg113.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion
1515

16-
neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type
16+
neg113.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type
1717
'{| a: int; b: int |}'
1818
is not compatible with type
1919
'{| a: int |}'
2020

21+
neg113.fs(18,34,18,36): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
2122

22-
neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
23-
24-
neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
23+
neg113.fs(20,42,20,44): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

tests/fsharp/typecheck/sigs/neg113.vsbsl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@ neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have
55

66
neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion
77

8-
neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type
8+
neg113.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type
99
'{| b: int |}'
1010
is not compatible with type
1111
'{| a: int |}'
1212

1313

1414
neg113.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion
1515

16-
neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type
16+
neg113.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type
1717
'{| a: int; b: int |}'
1818
is not compatible with type
1919
'{| a: int |}'
2020

2121

22-
neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
22+
neg113.fs(18,34,18,36): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
23+
24+
neg113.fs(20,42,20,44): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
2325

24-
neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

tests/fsharp/typecheck/sigs/neg15.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ module M =
8989
static member Method34() = noErrorPrivateValueLaterInferredToInvolvePrivateUnionType := [DefaultTagOfPrivateType(3)]
9090
static member Method35() = noErrorPrivateValueLaterInferredToInvolveInternalUnionType := [DefaultTagOfInternalType(3)]
9191

92-
type Type with
92+
type Type with
9393

94-
// Check we can access private things from an in-file augmentation
95-
member x.NoError51 = x.PrivateProperty
96-
member x.NoError52 = Type.PrivateStaticProperty
97-
static member NoError53 = Type.PrivateStaticProperty
98-
static member NoError54 = Type.PrivateStaticMethod()
94+
// Check we can access private things from an in-file augmentation
95+
member x.NoError51 = x.PrivateProperty
96+
member x.NoError52 = Type.PrivateStaticProperty
97+
static member NoError53 = Type.PrivateStaticProperty
98+
static member NoError54 = Type.PrivateStaticMethod()
9999

100100

101101
module N =

tests/fsharp/typecheck/sigs/neg16.bsl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ neg16.fs(44,10,44,11): typecheck error FS0934: Records, union, abbreviations and
1313

1414
neg16.fs(47,10,47,13): typecheck error FS0934: Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute
1515

16-
neg16.fs(49,7,49,23): typecheck error FS0842: This attribute is not valid for use on this language element
16+
neg16.fs(49,7,49,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, interface
17+
18+
neg16.fs(49,7,49,23): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, interface
19+
20+
neg16.fs(52,7,52,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, interface
21+
22+
neg16.fs(52,7,52,23): typecheck error FS0842: This attribute cannot be applied to method, return value. Valid targets are: class, interface
1723

18-
neg16.fs(52,7,52,23): typecheck error FS0842: This attribute is not valid for use on this language element
1924

2025
neg16.fs(59,8,59,17): typecheck error FS0001: This expression was expected to have type
2126
'Choice<'a,'b>'
@@ -121,4 +126,6 @@ neg16.fs(113,9,113,11): typecheck error FS0879: Volatile fields must be marked '
121126

122127
neg16.fs(116,9,116,10): typecheck error FS0879: Volatile fields must be marked 'mutable' and cannot be thread-static
123128

129+
neg16.fs(119,17,119,18): typecheck error FS0880: Uninitialized 'val' fields must be mutable and marked with the '[<DefaultValue>]' attribute. Consider using a 'let' binding instead of a 'val' field.
130+
124131
neg16.fs(130,10,130,11): typecheck error FS0935: Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal

0 commit comments

Comments
 (0)