-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master to feature/tasks (#9614)
* Moved fsharpqa/Libraries/Core/Unchecked test cases to NUnit (#9576) * Moved fsharpqa/Libraries/Core/Reflectiontest cases to NUnit (#9611) * Migrated PreComputedTupleConstructor01.fs test case * Migrated PreComputedTupleConstructor02.fs test case * Migrated DU.fs and Record.fs test cases * Allow notebook to discover location of shared framework (#9596) Co-authored-by: Thorsten Reichert <ThorstenReichert@users.noreply.github.com> Co-authored-by: Kevin Ransom (msft) <codecutter@hotmail.com> Co-authored-by: Phillip Carter <pcarter@fastmail.com>
- Loading branch information
1 parent
e4f9699
commit 0328e39
Showing
9 changed files
with
60 additions
and
50 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
tests/fsharp/Compiler/Libraries/Core/Reflection/PreComputedTupleConstructorTests.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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
||
namespace FSharp.Compiler.UnitTests | ||
|
||
open NUnit.Framework | ||
|
||
[<TestFixture>] | ||
module ``PreComputedTupleConstructor Tests`` = | ||
|
||
[<Test>] | ||
let ``PreComputedTupleConstructor of int and string``() = | ||
// Regression test for FSHARP1.0:5113 | ||
// MT DCR: Reflection.FSharpValue.PreComputeTupleConstructor fails when executed for NetFx 2.0 by a Dev10 compiler | ||
|
||
let testDelegate = TestDelegate (fun () -> | ||
Reflection.FSharpValue.PreComputeTupleConstructor(typeof<int * string>) [| box 12; box "text" |] |> ignore) | ||
|
||
Assert.DoesNotThrow testDelegate |> ignore | ||
|
||
[<Test>] | ||
let ``PreComputedTupleConstructor with wrong order of arguments``() = | ||
// Regression test for FSHARP1.0:5113 | ||
// MT DCR: Reflection.FSharpValue.PreComputeTupleConstructor fails when executed for NetFx 2.0 by a Dev10 compiler | ||
|
||
let testDelegate = TestDelegate (fun () -> | ||
Reflection.FSharpValue.PreComputeTupleConstructor(typeof<int * string>) [| box "text"; box 12; |] |> ignore) | ||
|
||
Assert.Throws<System.ArgumentException> testDelegate |> ignore |
28 changes: 28 additions & 0 deletions
28
tests/fsharp/Compiler/Libraries/Core/Reflection/SprintfTests.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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
||
namespace FSharp.Compiler.UnitTests | ||
|
||
open NUnit.Framework | ||
|
||
[<TestFixture>] | ||
module ``Sprintf Tests`` = | ||
|
||
type MyR = {c:int;b:int;a:int} | ||
|
||
[<Test>] | ||
let ``Sprintf %A of record type``() = | ||
// Regression test for FSHARP1.0:5113 | ||
|
||
let s1 = sprintf "%A" {a=1;b=2;c=3} | ||
let s2 = sprintf "%A" {c=3;b=2;a=1} | ||
|
||
Assert.areEqual s1 s2 | ||
|
||
type MyT = MyC of int * string * bool | ||
|
||
[<Test>] | ||
let ``Sprintf %A of discriminated union type``() = | ||
// Regression test for FSHARP1.0:5113 | ||
|
||
let DU = MyC (1,"2",true) | ||
Assert.areEqual "MyC (1, \"2\", true)" (sprintf "%A" DU) |
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
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
tests/fsharpqa/Source/Libraries/Core/Reflection/PreComputeTupleConstructor01.fs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
tests/fsharpqa/Source/Libraries/Core/Reflection/PreComputeTupleConstructor02.fs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.