Skip to content

Commit

Permalink
Show that conversion from unicode to uint16 works - references dotnet…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 31, 2015
1 parent db7374b commit 1b68e6f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fsharp/FSharp.Compiler.Unittests/Unicode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ type Unicodetest() =
Assert.AreEqual(55040us,"\uD700".[0] |> uint16)
Assert.AreEqual(55296us,"\uD800".[0] |> uint16)
Assert.AreEqual(55552us,"\uD900".[0] |> uint16)
Assert.AreEqual(57344us,"\uE000".[0] |> uint16)
Assert.AreEqual(57344us,"\uE000".[0] |> uint16)

[<Test>]
// checks #338
member this.``Can encode all unicode characters``()=
for i in [1us..65533us] do
let s = (i |> char).ToString()
let r = s.[0] |> uint16
Assert.AreEqual(i, r)

0 comments on commit 1b68e6f

Please sign in to comment.