Skip to content

Commit

Permalink
Add a failing test for dotnet#212
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Feb 4, 2015
1 parent 468487f commit bedc4d7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="NUnitFrameworkShims.fs" Condition="'$(TargetFramework)' == 'sl3-wp'" />
<Compile Include="RecordInitialisation.fs" />
<Compile Include="HashIfExpression.fs" />
</ItemGroup>
<ItemGroup>
Expand Down
27 changes: 27 additions & 0 deletions src/fsharp/FSharp.Compiler.Unittests/RecordInitialisation.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace FSharp.Compiler.Unittests

open System
open System.Text
open NUnit.Framework
open Microsoft.FSharp.Compiler

type Foo = {
A : int
B : int
C : int
}

[<TestFixture>]
type OrderOfRecordInitialisation() =

[<Test>]
member this.ShouldInitialzeInGivenOrder() =
let order = ref ""
let _ =
{ A = let _ = order := !order + "1" in 0
C = let _ = order := !order + "2" in 0
B = let _ = order := !order + "3" in 0 }

Assert.AreEqual(!order, "123")

0 comments on commit bedc4d7

Please sign in to comment.