Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving AccessOfTypeAbbreviationTests over to NUnit #7226

Merged
merged 5 commits into from
Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.UnitTests

open NUnit.Framework
open FSharp.Compiler.SourceCodeServices

[<TestFixture>]
module ``Access Of Type Abbreviation`` =

[<Test>]
let ``Test1``() =
CompilerAssert.TypeCheckSingleError
"""
module Library =
type private Hidden = Hidden of unit
type Exported = Hidden
"""
FSharpErrorSeverity.Warning
44
(4, 8, 4, 16)
"This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in.\r\nAs of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."

[<Test>]
let ``Test2``() =
CompilerAssert.Pass
"""
module Library =
type internal Hidden = Hidden of unit
type internal Exported = Hidden
"""

[<Test>]
let ``Test3``() =
CompilerAssert.TypeCheckSingleError
"""
module Library =
type internal Hidden = Hidden of unit
type Exported = Hidden
"""
FSharpErrorSeverity.Warning
44
(4, 8, 4, 16)
"This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in.\r\nAs of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."

[<Test>]
let ``Test4``() =
CompilerAssert.TypeCheckSingleError
"""
module Library =
type private Hidden = Hidden of unit
type internal Exported = Hidden
"""
FSharpErrorSeverity.Warning
44
(4, 17, 4, 25)
"This construct is deprecated. The type 'Hidden' is less accessible than the value, member or type 'Exported' it is used in.\r\nAs of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors."

[<Test>]
let ``Test5``() =
CompilerAssert.Pass
"""
module Library =
type private Hidden = Hidden of unit
type private Exported = Hidden
"""

[<Test>]
let ``Test6``() =
CompilerAssert.Pass
"""
module Library =
type Hidden = Hidden of unit
type Exported = Hidden
"""
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Compile Include="tests.fs" />
<Compile Include="Compiler\ILChecker.fs" />
<Compile Include="Compiler\CompilerAssert.fs" />
<Compile Include="Compiler\ErrorMessages\AccessOfTypeAbbreviationTests.fs" />
<Compile Include="Compiler\ErrorMessages\ElseBranchHasWrongTypeTests.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
<Compile Include="Compiler\Language\AnonRecordTests.fs" />
Expand Down
8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation2.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation3.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation4.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation5.fs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fsharpqa/Source/Warnings/AccessOfTypeAbbreviation6.fs

This file was deleted.

6 changes: 0 additions & 6 deletions tests/fsharpqa/Source/Warnings/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
SOURCE=WrongArity.fs # WrongArity.fs
SOURCE=OverrideErrors.fs # OverrideErrors.fs
SOURCE=MethodIsNotStatic.fs # MethodIsNotStatic.fs
SOURCE=AccessOfTypeAbbreviation.fs # AccessOfTypeAbbreviation.fs
SOURCE=AccessOfTypeAbbreviation2.fs # AccessOfTypeAbbreviation2.fs
SOURCE=AccessOfTypeAbbreviation3.fs # AccessOfTypeAbbreviation3.fs
SOURCE=AccessOfTypeAbbreviation4.fs # AccessOfTypeAbbreviation4.fs
SOURCE=AccessOfTypeAbbreviation5.fs # AccessOfTypeAbbreviation5.fs
SOURCE=AccessOfTypeAbbreviation6.fs # AccessOfTypeAbbreviation6.fs
SOURCE=EqualsInsteadOfInInForLoop.fs # EqualsInsteadOfInInForLoop.fs
SOURCE=DontWarnExternalFunctionAsUnused.fs SCFLAGS="--warnon:1182 --warnaserror+" # DontWarnExternalFunctionAsUnused.fs
SOURCE=SuggestTypesInModule.fs # SuggestTypesInModule.fs
Expand Down