Adjust code and fix all unit tests errors.

This commit is contained in:
BDisp
2023-05-10 17:30:04 +01:00
parent 87ce3127c5
commit 2048965ba6
29 changed files with 651 additions and 651 deletions

View File

@@ -156,13 +156,13 @@ namespace Terminal.Gui.ViewsTests {
[Fact]
public void Test_SumColumnWidth_UnicodeLength ()
{
Assert.Equal (11, "hello there".Sum (c => ((Rune)c).ColumnWidth ()));
Assert.Equal (11, "hello there".EnumerateRunes ().Sum (c => c.ColumnWidth ()));
// Creates a string with the peculiar (french?) r symbol
String surrogate = "Les Mise" + Char.ConvertFromUtf32 (Int32.Parse ("0301", NumberStyles.HexNumber)) + "rables";
// The unicode width of this string is shorter than the string length!
Assert.Equal (14, surrogate.Sum (c => ((Rune)c).ColumnWidth ()));
Assert.Equal (14, surrogate.EnumerateRunes ().Sum (c => c.ColumnWidth ()));
Assert.Equal (15, surrogate.Length);
}