aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-08-22 16:34:47 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-08-22 16:34:47 -0400
commit2835799ac0581f667c9ef9b66fe2b155a5348ae5 (patch)
tree7405670a30895c5a81c64c315fbe5040b7d4e147 /test
parentd9ae118774a156b5d8ed2f1f2747c65bca0ce76a (diff)
downloadtextadept-2835799ac0581f667c9ef9b66fe2b155a5348ae5.tar.gz
textadept-2835799ac0581f667c9ef9b66fe2b155a5348ae5.zip
Added `ui.command_entry.active` and fixed bugs in `events.KEYPRESS` handlers.
Diffstat (limited to 'test')
-rw-r--r--test/test.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index db3c2b39..7e7894af 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1161,6 +1161,7 @@ function test_command_entry_run()
['\t'] = function() tab_pressed = true end
}, nil, 2)
ui.update() -- redraw command entry
+ assert_equal(ui.command_entry.active, true)
assert_equal(ui.command_entry:get_lexer(), 'text')
assert(ui.command_entry.height > ui.command_entry:text_height(0), 'height < 2 lines')
ui.command_entry:set_text('foo')
@@ -1168,6 +1169,7 @@ function test_command_entry_run()
events.emit(events.KEYPRESS, not CURSES and 0xFF0D or 343) -- \n
assert_equal(command_run, 'foo')
assert(tab_pressed, '\\t not registered')
+ assert_equal(ui.command_entry.active, false)
assert_raises(function() ui.command_entry.run(function() end, 1) end, 'table/string/nil expected, got number')
assert_raises(function() ui.command_entry.run(function() end, {}, 1) end, 'string/nil expected, got number')