From 02cf813eff2282cdfce9cc9a9b997c1e16e38343 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 30 Jan 2016 21:36:33 +0100 Subject: Add test files for patch 7.4.771. vim-patch:efcabd6892ad89a4585fb77aa94c3b1802b784ab --- test/functional/legacy/search_mbyte_spec.lua | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/functional/legacy/search_mbyte_spec.lua (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/search_mbyte_spec.lua b/test/functional/legacy/search_mbyte_spec.lua new file mode 100644 index 0000000000..58c064161b --- /dev/null +++ b/test/functional/legacy/search_mbyte_spec.lua @@ -0,0 +1,31 @@ +-- Test for search('multi-byte char', 'bce') + +local helpers = require('test.functional.helpers') +local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect + +describe('search_mbyte', function() + setup(clear) + + it('is working', function() + insert([=[ + Results: + + Test bce: + A]=]) + + execute('source small.vim') + execute('source mbyte.vim') + execute('set encoding=utf-8') + execute('/^Test bce:/+1') + execute([[$put =search('A', 'bce', line('.'))]]) + + -- Assert buffer contents. + expect([=[ + Results: + + Test bce: + A + 4]=]) + end) +end) -- cgit From 696adeb0f652e32d5865e606117c3408ead6c97c Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Mon, 1 Feb 2016 08:52:24 +0100 Subject: Use before_each instead of setup in the test. --- test/functional/legacy/search_mbyte_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/search_mbyte_spec.lua b/test/functional/legacy/search_mbyte_spec.lua index 58c064161b..832fc1c831 100644 --- a/test/functional/legacy/search_mbyte_spec.lua +++ b/test/functional/legacy/search_mbyte_spec.lua @@ -5,7 +5,7 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect describe('search_mbyte', function() - setup(clear) + before_each(clear) it('is working', function() insert([=[ -- cgit From 63a12e1e2d0ed3c057f491e57b88e096b9d03215 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Mon, 1 Feb 2016 08:53:59 +0100 Subject: Remove unused variables from the test. --- test/functional/legacy/search_mbyte_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/search_mbyte_spec.lua b/test/functional/legacy/search_mbyte_spec.lua index 832fc1c831..d807e69b68 100644 --- a/test/functional/legacy/search_mbyte_spec.lua +++ b/test/functional/legacy/search_mbyte_spec.lua @@ -1,7 +1,7 @@ -- Test for search('multi-byte char', 'bce') local helpers = require('test.functional.helpers') -local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local insert = helpers.insert local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect describe('search_mbyte', function() -- cgit From 69234f4a76ca334d670bbf1830c5d70f40d0beb8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 15 Feb 2016 01:46:04 -0500 Subject: test: search_mbyte_spec: minor cleanup mbyte.vim, small.vim are not relevant to migrated legacy tests. --- test/functional/legacy/search_mbyte_spec.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'test/functional/legacy') diff --git a/test/functional/legacy/search_mbyte_spec.lua b/test/functional/legacy/search_mbyte_spec.lua index d807e69b68..075b24b897 100644 --- a/test/functional/legacy/search_mbyte_spec.lua +++ b/test/functional/legacy/search_mbyte_spec.lua @@ -1,5 +1,3 @@ --- Test for search('multi-byte char', 'bce') - local helpers = require('test.functional.helpers') local insert = helpers.insert local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect @@ -7,16 +5,13 @@ local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect describe('search_mbyte', function() before_each(clear) - it('is working', function() + it("search('multi-byte char', 'bce')", function() insert([=[ Results: Test bce: A]=]) - execute('source small.vim') - execute('source mbyte.vim') - execute('set encoding=utf-8') execute('/^Test bce:/+1') execute([[$put =search('A', 'bce', line('.'))]]) -- cgit