diff options
-rw-r--r-- | test/test.lua | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/test/test.lua b/test/test.lua index 450ba474..e21e3da8 100644 --- a/test/test.lua +++ b/test/test.lua @@ -987,13 +987,11 @@ function test_bookmarks() assert(has_bookmark(LINE(2)), 'no bookmark') textadept.bookmarks.toggle() assert(not has_bookmark(LINE(2)), 'bookmark still there') - textadept.bookmarks.toggle(true, LINE(1)) - assert(has_bookmark(LINE(1)), 'no bookmark') - textadept.bookmarks.toggle(false, LINE(1)) - assert(not has_bookmark(LINE(1)), 'bookmark still there') - textadept.bookmarks.toggle(true, LINE(1)) - textadept.bookmarks.toggle(true, LINE(2)) + buffer:goto_pos(buffer:position_from_line(LINE(1))) + textadept.bookmarks.toggle() + buffer:goto_pos(buffer:position_from_line(LINE(2))) + textadept.bookmarks.toggle() textadept.bookmarks.goto_mark(true) assert_equal(buffer:line_from_position(buffer.current_pos), LINE(1)) textadept.bookmarks.goto_mark(true) @@ -1007,8 +1005,6 @@ function test_bookmarks() assert(not has_bookmark(LINE(2)), 'bookmark still there') buffer:set_save_point() io.close_buffer() - - assert_raises(function() textadept.bookmarks.toggle(true, 'foo') end, 'number/nil expected, got string') end function test_bookmarks_interactive() @@ -1459,6 +1455,13 @@ function test_editing_transpose_chars() buffer:char_left() textadept.editing.transpose_chars() assert_equal(buffer:get_text(), 'foobar') + buffer:clear_all() + buffer:add_text('⌘⇧⌥') + textadept.editing.transpose_chars() + assert_equal(buffer:get_text(), '⌘⌥⇧') + buffer:char_left() + textadept.editing.transpose_chars() + assert_equal(buffer:get_text(), '⌘⇧⌥') -- TODO: multiple selection? buffer:set_save_point() io.close_buffer() |