aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.lua')
-rw-r--r--test/test.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 6356ee1c..9767eaa8 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1788,6 +1788,28 @@ function test_editing_toggle_comment_lines()
buffer:undo() -- comment
buffer:undo() -- uncomment
assert_equal(buffer:get_text(), text) -- verify atomic undo
+ -- LuaFormatter off
+ buffer:set_text(table.concat({
+ '--foo',
+ ' --foo'
+ }, '\n'))
+ -- LuaFormatter on
+ offset = 2
+ buffer:select_all()
+ textadept.editing.toggle_comment()
+ -- LuaFormatter off
+ assert_equal(buffer:get_text(), table.concat({
+ 'foo',
+ ' foo'
+ }, '\n'))
+ -- LuaFormatter on
+ textadept.editing.toggle_comment()
+ -- LuaFormatter off
+ assert_equal(buffer:get_text(), table.concat({
+ '--foo',
+ '-- foo'
+ }, '\n'))
+ -- LuaFormatter on
buffer:close(true)
end