Fix suggestion overspill bounds

This commit is contained in:
Thomas
2023-04-01 07:59:18 +01:00
parent 66d89c6f3e
commit 86a2a2a956
2 changed files with 29 additions and 1 deletions

View File

@@ -102,6 +102,21 @@ namespace Terminal.Gui.ViewTests {
}
[Theory, AutoInitShutdown]
[InlineData("ffffffffffffffffffffffffff","ffffffffff")]
[InlineData("fffffffffff","ffffffffff")]
public void TestAutoAppendRendering_ShouldNotOverspill(string overspillUsing,string expectRender)
{
var tf = GetTextFieldsInViewSuggesting(overspillUsing);
// f is typed we should only see 'f' up to size of View (10)
Application.Driver.SendKeys('f',ConsoleKey.F,false,false,false);
tf.Redraw(tf.Bounds);
TestHelpers.AssertDriverContentsAre(expectRender,output);
Assert.Equal("f",tf.Text.ToString());
}
[Theory, AutoInitShutdown]
[InlineData(ConsoleKey.UpArrow)]
[InlineData(ConsoleKey.DownArrow)]