From 6511c24af8fa44b51690f1456f4d8ada04783886 Mon Sep 17 00:00:00 2001 From: Gustaf Lindstedt Date: Sat, 28 Feb 2015 19:33:17 +0800 Subject: legacy tests: migrate test19 --- .../legacy/019_smarttab_expandtab_spec.lua | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 test/functional/legacy/019_smarttab_expandtab_spec.lua (limited to 'test/functional/legacy') 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" 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" 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 ') + -- Test replacing with Tabs and then backspacing to undo it. + feed('0wR ') + -- Test replacing with Tabs. + feed('0wR ') + -- Test that copyindent works with expandtab set. + execute('set expandtab smartindent copyindent ts=8 sw=8 sts=8') + feed('o{x') + 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) -- cgit