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/ui/syntax_conceal_spec.lua | 44 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'test/functional/ui/syntax_conceal_spec.lua') diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index ee3e4fa32a..991443a2ea 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -1,6 +1,6 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute +local clear, feed, command = helpers.clear, helpers.feed, helpers.command local insert = helpers.insert if helpers.pending_win32(pending) then return end @@ -25,7 +25,7 @@ describe('Screen', function() describe("match and conceal", function() before_each(function() - execute("let &conceallevel=1") + command("let &conceallevel=1") end) describe("multiple", function() @@ -38,7 +38,7 @@ describe('Screen', function() && && ]]) - execute("syn match dAmpersand '[&][&]' conceal cchar=∧") + command("syn match dAmpersand '[&][&]' conceal cchar=∧") end) it("double characters.", function() @@ -123,8 +123,8 @@ describe('Screen', function() it("keyword instances in initially in the document.", function() feed("2ilambda") - execute("let &conceallevel=1") - execute("syn keyword kLambda lambda conceal cchar=λ") + command("let &conceallevel=1") + command("syn keyword kLambda lambda conceal cchar=λ") screen:expect([[ {1:λ} | {1:λ} | @@ -144,11 +144,11 @@ describe('Screen', function() before_each(function() feed("2") insert(" a region of text \n") - execute("let &conceallevel=1") + command("let &conceallevel=1") end) it('initially and conceal it.', function() - execute("syn region rText start='' end='' conceal cchar=R") + command("syn region rText start='' end='' conceal cchar=R") screen:expect([[ {1:R} | {1:R} | @@ -166,7 +166,7 @@ describe('Screen', function() it('initially and conceal its start tag and end tag.', function() -- concealends has a known bug (todo.txt) where the first match won't -- be replaced with cchar. - execute("syn region rText matchgroup=rMatch start='' end='' concealends cchar=-") + command("syn region rText matchgroup=rMatch start='' end='' concealends cchar=-") screen:expect([[ {1: } a region of text {1:-} | {1: } a region of text {1:-} | @@ -182,7 +182,7 @@ describe('Screen', function() end) it('that are nested and conceal the nested region\'s start and end tags.', function() - execute("syn region rText contains=rText matchgroup=rMatch start='' end='' concealends cchar=-") + command("syn region rText contains=rText matchgroup=rMatch start='' end='' concealends cchar=-") insert(" A region with a nested nested region. \n") screen:expect([[ {1: } a region of text {1:-} | @@ -201,10 +201,10 @@ describe('Screen', function() describe("a region of text", function() before_each(function() - execute("syntax conceal on") + command("syntax conceal on") feed("2") insert(" a region of text \n") - execute("syn region rText start='' end='' cchar=-") + command("syn region rText start='' end='' cchar=-") end) it("and turn on implicit concealing", function() @@ -223,10 +223,10 @@ describe('Screen', function() end) it("and then turn on, then off, and then back on implicit concealing.", function() - execute("syntax conceal off") + command("syntax conceal off") feed("2") insert(" italian text \n") - execute("syn region iText start='' end='' cchar=*") + command("syn region iText start='' end='' cchar=*") screen:expect([[ {1:-} | {1:-} | @@ -239,8 +239,8 @@ describe('Screen', function() {0:~ }| :syn region iText start='' end='' cchar=* | ]]) - execute("syntax conceal on") - execute("syn region iText start='' end='' cchar=*") + command("syntax conceal on") + command("syn region iText start='' end='' cchar=*") screen:expect([[ {1:-} | {1:-} | @@ -262,13 +262,13 @@ describe('Screen', function() insert("// No Conceal\n") insert('"Conceal without a cchar"\n') insert("+ With cchar\n\n") - execute("syn match noConceal '^//.*$'") - execute("syn match concealNoCchar '\".\\{-}\"$' conceal") - execute("syn match concealWCchar '^+.\\{-}$' conceal cchar=C") + command("syn match noConceal '^//.*$'") + command("syn match concealNoCchar '\".\\{-}\"$' conceal") + command("syn match concealWCchar '^+.\\{-}$' conceal cchar=C") end) it("0. No concealing.", function() - execute("let &conceallevel=0") + command("let &conceallevel=0") screen:expect([[ // No Conceal | "Conceal without a cchar" | @@ -284,7 +284,7 @@ describe('Screen', function() end) it("1. Conceal using cchar or reference listchars.", function() - execute("let &conceallevel=1") + command("let &conceallevel=1") screen:expect([[ // No Conceal | {1: } | @@ -300,7 +300,7 @@ describe('Screen', function() end) it("2. Hidden unless cchar is set.", function() - execute("let &conceallevel=2") + command("let &conceallevel=2") screen:expect([[ // No Conceal | | @@ -316,7 +316,7 @@ describe('Screen', function() end) it("3. Hide all concealed text.", function() - execute("let &conceallevel=3") + command("let &conceallevel=3") screen:expect([[ // No Conceal | | -- cgit From 0ac2afdec73711d8006d6227fcb1d7b658ccf184 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 03:23:16 +0300 Subject: functests: Fix some ui/*_spec tests --- test/functional/ui/syntax_conceal_spec.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/functional/ui/syntax_conceal_spec.lua') diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index 991443a2ea..28a104360d 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -52,7 +52,7 @@ describe('Screen', function() ^ | {0:~ }| {0:~ }| - :syn match dAmpersand '[&][&]' conceal cchar=∧ | + | ]]) end) @@ -68,7 +68,7 @@ describe('Screen', function() | {0:~ }| {0:~ }| - :syn match dAmpersand '[&][&]' conceal cchar=∧ | + | ]]) end) @@ -84,7 +84,7 @@ describe('Screen', function() | {0:~ }| {0:~ }| - :syn match dAmpersand '[&][&]' conceal cchar=∧ | + | ]]) end) @@ -100,7 +100,7 @@ describe('Screen', function() | {0:~ }| {0:~ }| - :syn match dAmpersand '[&][&]' conceal cchar=∧ | + | ]]) end) @@ -116,7 +116,7 @@ describe('Screen', function() ^ | {0:~ }| {0:~ }| - :syn match dAmpersand '[&][&]' conceal cchar=∧ | + | ]]) end) end) -- multiple @@ -135,7 +135,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :syn keyword kLambda lambda conceal cchar=λ | + | ]]) end) -- Keyword @@ -218,7 +218,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :syn region rText start='' end='' cchar=- | + | ]]) end) @@ -237,7 +237,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :syn region iText start='' end='' cchar=* | + | ]]) command("syntax conceal on") command("syn region iText start='' end='' cchar=*") @@ -251,7 +251,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :syn region iText start='' end='' cchar=* | + | ]]) end) end) -- a region of text (implicit concealing) @@ -279,7 +279,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :let &conceallevel=0 | + | ]]) end) @@ -295,7 +295,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :let &conceallevel=1 | + | ]]) end) @@ -311,7 +311,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :let &conceallevel=2 | + | ]]) end) @@ -327,7 +327,7 @@ describe('Screen', function() {0:~ }| {0:~ }| {0:~ }| - :let &conceallevel=3 | + | ]]) end) end) -- conceallevel -- cgit