Browse Source

unit test added

pull/2553/head
ahopper 7 years ago
parent
commit
8a9e997c6c
  1. 15
      tests/Avalonia.Controls.UnitTests/TextBoxTests.cs

15
tests/Avalonia.Controls.UnitTests/TextBoxTests.cs

@ -385,6 +385,21 @@ namespace Avalonia.Controls.UnitTests
Assert.True(target.SelectionEnd <= "123".Length);
}
}
[Fact]
public void CoerceCaretIndex_Doesnt_Cause_Exception_with_malformed_line_ending()
{
using (UnitTestApplication.Start(Services))
{
var target = new TextBox
{
Template = CreateTemplate(),
Text = "0123456789\r"
};
target.CaretIndex = 11;
Assert.True(true);
}
}
private static TestServices Services => TestServices.MockThreadingInterface.With(
standardCursorFactory: Mock.Of<IStandardCursorFactory>());

Loading…
Cancel
Save