-
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.
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
- Loading branch information
1 parent
b4e7147
commit bd8721f
Showing
8 changed files
with
58 additions
and
48 deletions.
There are no files selected for viewing
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.