-
Notifications
You must be signed in to change notification settings - Fork 832
Move ErrorMessages/NameResolution Tests to NUnit #7237
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bee8d13
Mark name resoltion error message tests for port to NUnit
kMutagene 7d0eb47
Add Nunit tests for FieldNotInRecord, RecordFieldProposal, and Global…
kMutagene 6a6acbf
Fix expected error message in FieldNotInRecord Compiler test
kMutagene f08b53d
Change global Qualifier after dot test back to original fsharpqa vers…
kMutagene 938940d
Remove unnecessary double ticks from NameResolution tests
kMutagene 9cc8864
Merge branch 'master' into MoveNameResolutionTests
KevinRansom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
tests/fsharp/Compiler/ErrorMessages/NameResolutionTests.fs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // 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 NameResolutionTests = | ||
|
|
||
| [<Test>] | ||
| let FieldNotInRecord () = | ||
| CompilerAssert.TypeCheckSingleError | ||
| """ | ||
| type A = { Hello:string; World:string } | ||
| type B = { Size:int; Height:int } | ||
| type C = { Wheels:int } | ||
| type D = { Size:int; Height:int; Walls:int } | ||
| type E = { Unknown:string } | ||
| type F = { Wallis:int; Size:int; Height:int; } | ||
|
|
||
| let r:F = { Size=3; Height=4; Wall=1 } | ||
| """ | ||
| FSharpErrorSeverity.Error | ||
| 1129 | ||
| (9, 31, 9, 35) | ||
| "The record type 'F' does not contain a label 'Wall'." | ||
|
|
||
| [<Test>] | ||
| let RecordFieldProposal () = | ||
| CompilerAssert.TypeCheckSingleError | ||
| """ | ||
| type A = { Hello:string; World:string } | ||
| type B = { Size:int; Height:int } | ||
| type C = { Wheels:int } | ||
| type D = { Size:int; Height:int; Walls:int } | ||
| type E = { Unknown:string } | ||
| type F = { Wallis:int; Size:int; Height:int; } | ||
|
|
||
| let r = { Size=3; Height=4; Wall=1 } | ||
| """ | ||
| FSharpErrorSeverity.Error | ||
| 39 | ||
| (9, 29, 9, 33) | ||
| "The record label 'Wall' is not defined." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
tests/fsharpqa/Source/ErrorMessages/NameResolution/E_FieldNotInRecord.fs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,4 @@ | |
|
|
||
| let x = global.System.String.Empty.global.System.String.Empty | ||
|
|
||
| exit 0 | ||
| exit 0 | ||
13 changes: 0 additions & 13 deletions
13
tests/fsharpqa/Source/ErrorMessages/NameResolution/E_RecordFieldProposal.fs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| SOURCE=E_RecordFieldProposal.fs # E_RecordFieldProposal | ||
| SOURCE=E_GlobalQualifierAfterDot.fs # E_GlobalQualifierAfterDot | ||
| SOURCE=E_FieldNotInRecord.fs # E_FieldNotInRecord | ||
| SOURCE=E_GlobalQualifierAfterDot.fs # E_GlobalQualifierAfterDot |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kMutagene,
Do you propose following up with a PR to migrate this test case? Feel free to add whatever is necessary to the CompilerAssert class.
Thanks
Kevin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new function is already coming in #7244 - so after merging that one @kMutagene can continue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK the new assertion function is in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @forki