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

Moved fsharpqa/Libraries/Core/ExtraTopLevelOperators test cases to NUnit #9388

Merged
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,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.