Skip to content

Commit

Permalink
Added multi line test to ensure no behaviour change from fixing (#4026)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goltanju committed Jul 4, 2023
1 parent bae1741 commit aa86bfe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions widget/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,16 @@ func TestSingleLineEntry_SelectionSubmitted(t *testing.T) {
assert.Equal(t, entry.Text, "abc")
}

func TestMultiLineEntry_EnterWithSelection(t *testing.T) {
entry := widget.NewMultiLineEntry()
entry.SetText("abc")
assert.Equal(t, "", entry.SelectedText())
entry.TypedShortcut(&fyne.ShortcutSelectAll{})
assert.Equal(t, "abc", entry.SelectedText())
entry.TypedKey(&fyne.KeyEvent{Name: fyne.KeyEnter})
assert.Equal(t, entry.Text, "\n")
}

func TestEntry_CarriageReturn(t *testing.T) {
entry := widget.NewMultiLineEntry()
entry.Wrapping = fyne.TextWrapOff
Expand Down

0 comments on commit aa86bfe

Please sign in to comment.