From e18d143a02f4d2619e3ee3cd93cae5bc395ee833 Mon Sep 17 00:00:00 2001 From: Mark Gascoyne Date: Tue, 18 Jun 2024 07:33:37 +0100 Subject: [PATCH] Add a test which shows the backspace issue --- output_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/output_test.go b/output_test.go index 156ba331..d07b7270 100644 --- a/output_test.go +++ b/output_test.go @@ -19,3 +19,13 @@ func TestTerminal_Backspace(t *testing.T) { assert.Equal(t, "Hello", term.content.Text()) } + +func TestTerminal_Backspace_Foreign_Characters(t *testing.T) { + term := New() + term.Resize(fyne.NewSize(50, 50)) + term.handleOutput([]byte("çîß")) + assert.Equal(t, "çîß", term.content.Text()) + + term.handleOutput([]byte{asciiBackspace}) + assert.Equal(t, "çî", term.content.Text()) +}