Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Migrated DU.fs and Record.fs test cases
  • Loading branch information
ThorstenReichert committed Jul 2, 2020
commit 6e595ea0ec858f673c3ecf51909cf85c83beefa9
28 changes: 28 additions & 0 deletions tests/fsharp/Compiler/Libraries/Core/Reflection/SprintfTests.fs
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)
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<Compile Include="Compiler\Libraries\Core\Operators\RoundTests.fs" />
<Compile Include="Compiler\Libraries\Core\Operators\SignTests.fs" />
<Compile Include="Compiler\Libraries\Core\Operators\StringTests.fs" />
<Compile Include="Compiler\Libraries\Core\Reflection\SprintfTests.fs" />
<Compile Include="Compiler\Libraries\Core\Reflection\PreComputedTupleConstructorTests.fs" />
<Compile Include="Compiler\Libraries\Core\Unchecked\DefaultOfTests.fs" />
<None Include="app.config" />
Expand Down
10 changes: 0 additions & 10 deletions tests/fsharpqa/Source/Libraries/Core/Reflection/DU.fs

This file was deleted.

10 changes: 0 additions & 10 deletions tests/fsharpqa/Source/Libraries/Core/Reflection/Record.fs

This file was deleted.

2 changes: 0 additions & 2 deletions tests/fsharpqa/Source/Libraries/Core/Reflection/env.lst

This file was deleted.