Skip to content

Commit

Permalink
moved fsharpqa/Libraries/Core/ExtraTopLevelOperators test cases to NU…
Browse files Browse the repository at this point in the history
…nit (#9388)
  • Loading branch information
ThorstenReichert authored Jun 3, 2020
1 parent b17ecf2 commit 6366d1e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 33 deletions.
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
"""
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="Compiler\Libraries\Core\Collections\MapTests.fs" />
<Compile Include="Compiler\Libraries\Core\Collections\CollectionTests.fs" />
<Compile Include="Compiler\Libraries\Core\Collections\ListTests.fs" />
<Compile Include="Compiler\Libraries\Core\ExtraTopLevelOperators\DictionaryTests.fs" />
<None Include="app.config" />
<None Include="update.base.line.with.actuals.fsx" />

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 6366d1e

Please sign in to comment.