Skip to content

Commit

Permalink
Show that escaped unicode characters are encoded incorrectly - refere…
Browse files Browse the repository at this point in the history
…nces dotnet#338
  • Loading branch information
forki committed Mar 31, 2015
1 parent 049d871 commit db7374b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<Compile Include="NUnitFrameworkShims.fs" Condition="'$(TargetFramework)' == 'sl3-wp'" />
<Compile Include="ManglingNameOfProvidedTypes.fs" />
<Compile Include="HashIfExpression.fs" />
<Compile Include="Unicode.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler\FSharp.Compiler.fsproj">
Expand Down
20 changes: 20 additions & 0 deletions src/fsharp/FSharp.Compiler.Unittests/Unicode.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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

[<TestFixture>]
type Unicodetest() =

[<Test>]
// checks #338
member this.``Escaped unicode characters are encoded correctly``()=
Assert.AreEqual(54528us,"\uD500".[0] |> uint16)
Assert.AreEqual(55040us,"\uD700".[0] |> uint16)
Assert.AreEqual(55296us,"\uD800".[0] |> uint16)
Assert.AreEqual(55552us,"\uD900".[0] |> uint16)
Assert.AreEqual(57344us,"\uE000".[0] |> uint16)

0 comments on commit db7374b

Please sign in to comment.