Benedikt Stebner преди 4 години
родител
ревизия
43beabc9b4
променени са 1 файла, в които са добавени 21 реда и са изтрити 0 реда
  1. 21 0
      tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextFormatterTests.cs

+ 21 - 0
tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextFormatterTests.cs

@@ -125,6 +125,27 @@ namespace Avalonia.Skia.UnitTests.Media.TextFormatting
             }
         }
 
+        [Fact]
+        public void Should_Produce_A_Single_Fallback_Run()
+        {
+            using (Start())
+            {
+                var defaultProperties = new GenericTextRunProperties(Typeface.Default);
+
+                const string text = "👍 👍 👍 👍";
+                
+                var textSource = new SingleBufferTextSource(text, defaultProperties);
+
+                var formatter = new TextFormatterImpl();
+
+                var textLine =
+                    formatter.FormatLine(textSource, 0, double.PositiveInfinity,
+                        new GenericTextParagraphProperties(defaultProperties));
+
+                Assert.Equal(1, textLine.TextRuns.Count);
+            } 
+        }
+
         [Fact]
         public void Should_Split_Run_On_Script()
         {