aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-02 15:57:44 -0400
committermitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-02 15:57:44 -0400
commitfbdab8f56e606d28f74d26bc729c8f835aed23db (patch)
treea0f95afb6b175059bb58dad884d172affcb9b200 /test
parent19ab592c17cb5c0fbf16de34ffba25d2f95f7cc4 (diff)
downloadtextadept-fbdab8f56e606d28f74d26bc729c8f835aed23db.tar.gz
textadept-fbdab8f56e606d28f74d26bc729c8f835aed23db.zip
Command entry also considers contents of `textadept` as globals.
Include buffer/view constants as well, which should have been there anyway.
Diffstat (limited to 'test')
-rw-r--r--test/test.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 5f2fcb45..d89937a7 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1242,6 +1242,11 @@ function test_command_entry_run_lua_abbreviated_env()
run_lua_command('foo="bar"')
run_lua_command('foo')
assert(buffer:get_text():find('bar%s*$'), 'foo result not "bar"')
+ -- textadept get/set.
+ run_lua_command('editing')
+ assert(buffer:get_text():find('%b{}%s*$'), 'textadept.editing result not a table')
+ run_lua_command('editing.select_paragraph')
+ assert(buffer.selection_start ~= buffer.selection_end, 'textadept.editing.select_paragraph() did not select paragraph')
buffer:close()
end
@@ -1263,10 +1268,16 @@ function test_command_entry_complete_lua()
ui.command_entry.run()
assert_lua_autocompletion('string.', 'byte')
assert_lua_autocompletion('auto', 'auto_c_active')
+ assert_lua_autocompletion('MARK', 'MARKER_MAX')
assert_lua_autocompletion('buffer.auto', 'auto_c_auto_hide')
assert_lua_autocompletion('buffer:auto', 'auto_c_active')
+ assert_lua_autocompletion('caret', 'caret_fore')
+ assert_lua_autocompletion('ANNO', 'ANNOTATION_BOXED')
+ assert_lua_autocompletion('view.margin', 'margin_back_n')
+ assert_lua_autocompletion('view:call', 'call_tip_active')
assert_lua_autocompletion('goto', 'goto_buffer')
assert_lua_autocompletion('_', '_BUFFERS')
+ assert_lua_autocompletion('fi', 'file_types')
-- TODO: textadept.editing.show_documentation key binding.
ui.command_entry:focus() -- hide
end