aboutsummaryrefslogtreecommitdiff
path: root/test/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.lua')
-rw-r--r--test/test.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 1505f2c2..047f6601 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -786,6 +786,23 @@ function test_ui_print()
ui.silent_print = silent_print
end
+function test_ui_print_to_other_view()
+ local silent_print = ui.silent_print
+
+ ui.silent_print = false
+ view:split()
+ ui.goto_view(-1)
+ assert_equal(_VIEWS[view], 1)
+ ui.print('foo') -- should print to other view, not split again
+ assert_equal(#_VIEWS, 2)
+ assert_equal(_VIEWS[view], 2)
+ buffer:close()
+ ui.goto_view(-1)
+ view:unsplit()
+
+ ui.silent_print = silent_print
+end
+
function test_ui_dialogs_colorselect_interactive()
local color = ui.dialogs.colorselect{title = 'Blue', color = 0xFF0000}
assert_equal(color, 0xFF0000)
@@ -1729,6 +1746,12 @@ function test_editing_transpose_chars()
buffer:char_left()
textadept.editing.transpose_chars()
assert_equal(buffer:get_text(), '⌘⇧⌥')
+ buffer:clear_all()
+ textadept.editing.transpose_chars()
+ assert_equal(buffer:get_text(), '')
+ buffer:add_text('a')
+ textadept.editing.transpose_chars()
+ assert_equal(buffer:get_text(), 'a')
-- TODO: multiple selection?
buffer:close(true)
end