-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved fsharpqa/Libraries/Core/ExtraTopLevelOperators test cases to NU…
…nit (#9388)
- Loading branch information
1 parent
b17ecf2
commit 6366d1e
Showing
5 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
tests/fsharp/Compiler/Libraries/Core/ExtraTopLevelOperators/DictionaryTests.fs
This file contains 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,47 @@ | ||
// 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.TestHelpers | ||
|
||
module ``Dictionary Tests`` = | ||
|
||
[<Test>] | ||
let ``Assigning to dictionary should compile``() = | ||
// Regression test for FSHARP1.0:5365 | ||
|
||
CompilerAssert.Pass | ||
""" | ||
module N.M | ||
open System | ||
open System.Collections.Generic | ||
type ICloneable<'a> = | ||
abstract Clone : unit -> 'a | ||
type DictionaryFeature<'key> (dict: IDictionary<'key, int>) = | ||
member this.Add key value = | ||
dict.[key] <- value | ||
""" | ||
|
||
[<Test>] | ||
let ``Assigning to dictionary with type constraint should compile``() = | ||
// Regression test for FSHARP1.0:5365 | ||
// Used to give error: value must be local and mutable in order to mutate the contents of a value type, e.g. 'let mutable x = ...' | ||
|
||
CompilerAssert.Pass | ||
""" | ||
module N.M | ||
open System | ||
open System.Collections.Generic | ||
type ICloneable<'a> = | ||
abstract Clone : unit -> 'a | ||
type DictionaryFeature<'key, 'dict when 'dict :> IDictionary<'key, int> and 'dict :> ICloneable<'dict>> (dict: 'dict) = | ||
member this.Add key value = | ||
dict.[key] <- value | ||
""" |
This file contains 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
16 changes: 0 additions & 16 deletions
16
tests/fsharpqa/Source/Libraries/Core/ExtraTopLevelOperators/dict_typecheck01.fs
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
tests/fsharpqa/Source/Libraries/Core/ExtraTopLevelOperators/dict_typecheck02.fs
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
tests/fsharpqa/Source/Libraries/Core/ExtraTopLevelOperators/env.lst
This file was deleted.
Oops, something went wrong.