aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/testdir/test19.in33
-rw-r--r--src/nvim/testdir/test19.ok10
-rw-r--r--test/functional/legacy/019_smarttab_expandtab_spec.lua56
3 files changed, 56 insertions, 43 deletions
diff --git a/src/nvim/testdir/test19.in b/src/nvim/testdir/test19.in
deleted file mode 100644
index aafa34e521..0000000000
--- a/src/nvim/testdir/test19.in
+++ /dev/null
@@ -1,33 +0,0 @@
-Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
-Also test that dv_ works correctly
-
-STARTTEST
-:so small.vim
-:set smarttab expandtab ts=8 sw=4
-:" make sure that backspace works, no matter what termcap is used
-:set t_kD=x7f t_kb=x08
-/some
-r :set noexpandtab
-/other
-r
-:" Test replacing with Tabs and then backspacing to undo it
-0wR 
-:" Test replacing with Tabs
-0wR 
-:" Test that copyindent works with expandtab set
-:set expandtab smartindent copyindent ts=8 sw=8 sts=8
-o{
-x:set nosol
-/Second line/
-fwdv_:?^start?,$w! test.out
-:qa!
-ENDTEST
-
-start text
- some test text
-test text
- other test text
- a cde
- f ghi
-test text
- Second line beginning with whitespace
diff --git a/src/nvim/testdir/test19.ok b/src/nvim/testdir/test19.ok
deleted file mode 100644
index 4146214919..0000000000
--- a/src/nvim/testdir/test19.ok
+++ /dev/null
@@ -1,10 +0,0 @@
-start text
- ome test text
-test text
- ther test text
- a cde
- hi
-test text
-{
- x
- with whitespace
diff --git a/test/functional/legacy/019_smarttab_expandtab_spec.lua b/test/functional/legacy/019_smarttab_expandtab_spec.lua
new file mode 100644
index 0000000000..a33bd0c3ae
--- /dev/null
+++ b/test/functional/legacy/019_smarttab_expandtab_spec.lua
@@ -0,0 +1,56 @@
+-- Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
+-- Also test that dv_ works correctly
+
+local helpers = require('test.functional.helpers')
+local feed, insert = helpers.feed, helpers.insert
+local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
+
+describe([[performing "r<Tab>" with 'smarttab' and 'expandtab' set/not set, and "dv_"]], function()
+ setup(clear)
+
+ it('is working', function()
+ insert([[
+ start text
+ some test text
+ test text
+ other test text
+ a cde
+ f ghi
+ test text
+ Second line beginning with whitespace]])
+
+ execute('set smarttab expandtab ts=8 sw=4')
+ -- Make sure that backspace works, no matter what termcap is used.
+ execute('set t_kD=x7f t_kb=x08')
+
+ execute('/some')
+ feed('r ')
+ execute('set noexpandtab')
+ execute('/other')
+ feed('r <cr>')
+ -- Test replacing with Tabs and then backspacing to undo it.
+ feed('0wR <bs><bs><bs><esc><cr>')
+ -- Test replacing with Tabs.
+ feed('0wR <esc><cr>')
+ -- Test that copyindent works with expandtab set.
+ execute('set expandtab smartindent copyindent ts=8 sw=8 sts=8')
+ feed('o{<cr>x<esc>')
+ execute('set nosol')
+ execute('/Second line/')
+ -- Test "dv_"
+ feed('fwdv_')
+
+ -- Assert buffer contents.
+ expect([[
+ start text
+ ome test text
+ test text
+ ther test text
+ a cde
+ hi
+ test text
+ {
+ x
+ with whitespace]])
+ end)
+end)