mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Fixes #2655. Should be avoid cast to char on a Rune ctor which always fallback for a UTF16 char. (#2656)
This commit is contained in:
@@ -711,4 +711,13 @@ public class RuneTests {
|
||||
Assert.Equal (utf16Length, r.Utf16SequenceLength);
|
||||
Assert.Equal (utf8Length, r.Utf8SequenceLength);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Cast_To_Char_Durrogate_Pair_Return_UTF16 ()
|
||||
{
|
||||
Assert.NotEqual ("𝔹", $"{new Rune (unchecked((char)0x1d539))}");
|
||||
Assert.Equal ("픹", $"{new Rune (unchecked((char)0x1d539))}");
|
||||
Assert.Equal ("픹", $"{new Rune (0xd539)}");
|
||||
Assert.Equal ("𝔹", $"{new Rune (0x1d539)}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user