From 426e323063217b4395dd1871392d3df13c30ed4f Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 24 May 2020 15:06:48 -0400 Subject: Updated tests for recent command entry history change. --- test/test.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'test/test.lua') diff --git a/test/test.lua b/test/test.lua index 1d920f6e..e67f02ae 100644 --- a/test/test.lua +++ b/test/test.lua @@ -1212,9 +1212,9 @@ function test_command_entry_history() events.emit(events.KEYPRESS, not CURSES and 0xFF0D or 343) -- \n ui.command_entry.run(one) - assert_equal(ui.command_entry:get_text(), '') - events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up assert_equal(ui.command_entry:get_text(), 'foo') + assert_equal(ui.command_entry.selection_start, 1) + assert_equal(ui.command_entry.selection_end, 4) events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up assert_equal(ui.command_entry:get_text(), 'foo') -- no prior history events.emit(events.KEYPRESS, not CURSES and 0xFF54 or 300) -- down @@ -1224,8 +1224,6 @@ function test_command_entry_history() ui.command_entry.run(one) events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up - assert_equal(ui.command_entry:get_text(), 'baz') - events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up assert_equal(ui.command_entry:get_text(), 'foo') events.emit(events.KEYPRESS, not CURSES and 0xFF54 or 300) -- down assert_equal(ui.command_entry:get_text(), 'baz') @@ -1234,15 +1232,12 @@ function test_command_entry_history() ui.command_entry.run(one) events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up - assert_equal(ui.command_entry:get_text(), 'foo') - events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up assert_equal(ui.command_entry:get_text(), 'baz') events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up assert_equal(ui.command_entry:get_text(), 'foo') events.emit(events.KEYPRESS, not CURSES and 0xFF1B or 7) -- esc ui.command_entry.run(two) - events.emit(events.KEYPRESS, not CURSES and 0xFF52 or 301) -- up assert_equal(ui.command_entry:get_text(), 'bar') events.emit(events.KEYPRESS, not CURSES and 0xFF1B or 7) -- esc end -- cgit v1.2.3