From 65fb622000af8e3dbb65480e1581758ecf4ba3e2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 00:12:26 +0300 Subject: functests: Replace execute with either command or feed_command Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed. --- test/functional/legacy/listchars_spec.lua | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'test/functional/legacy/listchars_spec.lua') diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index d2838cddb6..3c0fa48e76 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -2,12 +2,12 @@ local helpers = require('test.functional.helpers')(after_each) local feed, insert, source = helpers.feed, helpers.insert, helpers.source -local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect +local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect describe("'listchars'", function() before_each(function() clear() - execute('set listchars&vi') + feed_command('set listchars&vi') end) it("works with 'list'", function() @@ -26,14 +26,14 @@ describe("'listchars'", function() dd ee ]]) - execute('let g:lines = []') + feed_command('let g:lines = []') -- Set up 'listchars', switch on 'list', and use the "GG" mapping to record -- what the buffer lines look like. - execute('set listchars+=tab:>-,space:.,trail:<') - execute('set list') - execute('/^start:/') - execute('normal! jzt') + feed_command('set listchars+=tab:>-,space:.,trail:<') + feed_command('set list') + feed_command('/^start:/') + feed_command('normal! jzt') feed('GG') feed('GG') feed('GG') @@ -41,7 +41,7 @@ describe("'listchars'", function() feed('GGH') -- Repeat without displaying "trail" spaces. - execute('set listchars-=trail:<') + feed_command('set listchars-=trail:<') feed('GG') feed('GG') feed('GG') @@ -49,8 +49,8 @@ describe("'listchars'", function() feed('GG') -- Delete the buffer contents and :put the collected lines. - execute('%d') - execute('put =g:lines', '1d') + feed_command('%d') + feed_command('put =g:lines', '1d') -- Assert buffer contents. expect([[ @@ -76,21 +76,21 @@ describe("'listchars'", function() -- Set up 'listchars', switch 'list' *off* (:list must show the 'listchars' -- even when 'list' is off), then run :list and collect the output. - execute('set listchars+=tab:>-,space:.,trail:<') - execute('set nolist') - execute('/^start:/') - execute('redir! => g:lines') - execute('+1,$list') - execute('redir END') + feed_command('set listchars+=tab:>-,space:.,trail:<') + feed_command('set nolist') + feed_command('/^start:/') + feed_command('redir! => g:lines') + feed_command('+1,$list') + feed_command('redir END') -- Delete the buffer contents and :put the collected lines. - execute('%d') - execute('put =g:lines', '1d') + feed_command('%d') + feed_command('put =g:lines', '1d') -- Assert buffer contents. expect([[ - - + + ..fff>--<<$ >-------gg>-----$ .....h>-$ -- cgit From 126b2ca077718a02c086039c8f98ef267cf9eb3e Mon Sep 17 00:00:00 2001 From: KillTheMule Date: Sun, 24 Sep 2017 20:42:48 +0200 Subject: test: lint whitespace in legacy/ (#7308) --- test/functional/legacy/listchars_spec.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/functional/legacy/listchars_spec.lua') diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index 3c0fa48e76..cffb9fd376 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -4,12 +4,14 @@ local helpers = require('test.functional.helpers')(after_each) local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect +-- luacheck: ignore 621 (Indentation) describe("'listchars'", function() before_each(function() clear() feed_command('set listchars&vi') end) + -- luacheck: ignore 613 (Trailing whitespace in a string) it("works with 'list'", function() source([[ function GetScreenCharsForLine(lnum) -- cgit