diff options
author | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-04-24 11:35:10 +0200 |
---|---|---|
committer | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-04-24 11:35:10 +0200 |
commit | ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (patch) | |
tree | 526b1df09b06121bdbc6ef5254ef53821958a6cb /test/functional/options | |
parent | 4049492b6d7b8805686b14dbacb3b729abd03308 (diff) | |
parent | 7f6d3d305269fd1139bc2aec9a91bf98ad595199 (diff) | |
download | rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.gz rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.bz2 rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.zip |
Merge branch 'master' into option-fixes
Diffstat (limited to 'test/functional/options')
-rw-r--r-- | test/functional/options/defaults_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/options/pastetoggle_spec.lua | 37 | ||||
-rw-r--r-- | test/functional/options/shortmess_spec.lua | 8 |
3 files changed, 43 insertions, 6 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index f57fe5fa23..f43d8eeafa 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local meths = helpers.meths -local execute = helpers.execute +local command = helpers.command local clear = helpers.clear local eval = helpers.eval local eq = helpers.eq @@ -25,7 +25,7 @@ describe('startup defaults', function() local function expect_filetype(expected) local screen = Screen.new(48, 4) screen:attach() - execute('filetype') + command('filetype') screen:expect([[ ^ | ~ | diff --git a/test/functional/options/pastetoggle_spec.lua b/test/functional/options/pastetoggle_spec.lua new file mode 100644 index 0000000000..ec3c60fe37 --- /dev/null +++ b/test/functional/options/pastetoggle_spec.lua @@ -0,0 +1,37 @@ +local helpers = require('test.functional.helpers')(after_each) + +local clear = helpers.clear +local feed = helpers.feed +local command = helpers.command +local eq = helpers.eq +local eval = helpers.eval +local sleep = helpers.sleep + +describe("'pastetoggle' option", function() + before_each(function() + clear() + command('set nopaste') + command('set pastetoggle=a') + end) + it("toggles 'paste'", function() + eq(eval('&paste'), 0) + feed('a') + -- Need another key so that the vgetorpeek() function returns. + feed('j') + eq(eval('&paste'), 1) + end) + it("multiple key 'pastetoggle' is waited for", function() + eq(eval('&paste'), 0) + local pastetoggle = 'lllll' + command('set pastetoggle=' .. pastetoggle) + command('set timeoutlen=1 ttimeoutlen=10000') + feed(pastetoggle:sub(0, 2)) + -- sleep() for long enough that vgetorpeek() is gotten into, but short + -- enough that ttimeoutlen is not reached. + sleep(200) + feed(pastetoggle:sub(3, -1)) + -- Need another key so that the vgetorpeek() function returns. + feed('j') + eq(eval('&paste'), 1) + end) +end) diff --git a/test/functional/options/shortmess_spec.lua b/test/functional/options/shortmess_spec.lua index 22e8a39b79..99a574ec46 100644 --- a/test/functional/options/shortmess_spec.lua +++ b/test/functional/options/shortmess_spec.lua @@ -1,6 +1,6 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local clear, execute = helpers.clear, helpers.execute +local clear, feed_command = helpers.clear, helpers.feed_command if helpers.pending_win32(pending) then return end @@ -19,7 +19,7 @@ describe("'shortmess'", function() describe('"F" flag', function() it('hides messages about the files read', function() - execute('e test') + feed_command('e test') screen:expect([[ ^ | ~ | @@ -27,8 +27,8 @@ describe("'shortmess'", function() ~ | "test" is a directory | ]]) - execute('set shortmess=F') - execute('e test') + feed_command('set shortmess=F') + feed_command('e test') screen:expect([[ ^ | ~ | |