1package ui23import "testing"45// Word keys edit the entry by word in ENTER and EDIT.6func TestEntryWordKeys(t *testing.T) {7 m := newModel()8 press(t, m, "=SUM(A1:B2", "<ctrl+backspace>")9 if got := m.line.Text(); got != "=SUM(A1:" {10 t.Fatalf("ctrl+backspace left %q", got)11 }12 press(t, m, "<alt+backspace>", "<f2>", "<ctrl+left>")13 if m.mode != modeEdit || m.line.Pos != 5 || m.cur != addr("A1") {14 t.Errorf("ctrl+left in EDIT: mode %v, caret %d, cell %v", m.mode, m.line.Pos, m.cur)15 }16 press(t, m, "<ctrl+u>")17 if got := m.line.Text(); got != "A1" {18 t.Errorf("ctrl+u left %q", got)19 }20}