diff options
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/022_line_ending_spec.lua | 25 | ||||
-rw-r--r-- | test/functional/legacy/041_writing_and_reading_hundred_kbyte_spec.lua | 43 | ||||
-rw-r--r-- | test/functional/legacy/045_folding_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/legacy/063_match_and_matchadd_spec.lua | 20 | ||||
-rw-r--r-- | test/functional/legacy/077_mf_hash_grow_spec.lua | 52 | ||||
-rw-r--r-- | test/functional/legacy/084_curswant_spec.lua | 49 | ||||
-rw-r--r-- | test/functional/legacy/098_scrollbind_spec.lua | 48 | ||||
-rw-r--r-- | test/functional/legacy/104_let_assignment_spec.lua | 54 | ||||
-rw-r--r-- | test/functional/legacy/assert_spec.lua | 54 | ||||
-rw-r--r-- | test/functional/legacy/breakindent_spec.lua | 214 | ||||
-rw-r--r-- | test/functional/legacy/delete_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/search_spec.lua | 34 |
12 files changed, 53 insertions, 545 deletions
diff --git a/test/functional/legacy/022_line_ending_spec.lua b/test/functional/legacy/022_line_ending_spec.lua deleted file mode 100644 index fb4b782011..0000000000 --- a/test/functional/legacy/022_line_ending_spec.lua +++ /dev/null @@ -1,25 +0,0 @@ --- Tests for file with some lines ending in CTRL-M, some not - -local helpers = require('test.functional.helpers')(after_each) -local clear, feed = helpers.clear, helpers.feed -local feed_command, expect = helpers.feed_command, helpers.expect - -describe('line ending', function() - setup(clear) - - it('is working', function() - feed('i', [[ - this lines ends in a<C-V><C-M> - this one doesn't - this one does<C-V><C-M> - and the last one doesn't]], '<ESC>') - - feed_command('set ta tx') - feed_command('e!') - - expect("this lines ends in a\r\n".. - "this one doesn't\n".. - "this one does\r\n".. - "and the last one doesn't") - end) -end) diff --git a/test/functional/legacy/041_writing_and_reading_hundred_kbyte_spec.lua b/test/functional/legacy/041_writing_and_reading_hundred_kbyte_spec.lua deleted file mode 100644 index b526d82519..0000000000 --- a/test/functional/legacy/041_writing_and_reading_hundred_kbyte_spec.lua +++ /dev/null @@ -1,43 +0,0 @@ --- Test for writing and reading a file of over 100 Kbyte - -local helpers = require('test.functional.helpers')(after_each) - -local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local command, expect = helpers.command, helpers.expect -local wait = helpers.wait - -describe('writing and reading a file of over 100 Kbyte', function() - setup(clear) - - it('is working', function() - insert([[ - This is the start - This is the leader - This is the middle - This is the trailer - This is the end]]) - - feed('kY3000p2GY3000p') - wait() - - command('w! test.out') - command('%d') - command('e! test.out') - command('yank A') - command('3003yank A') - command('6005yank A') - command('%d') - command('0put a') - command('$d') - command('w!') - - expect([[ - This is the start - This is the middle - This is the end]]) - end) - - teardown(function() - os.remove('test.out') - end) -end) diff --git a/test/functional/legacy/045_folding_spec.lua b/test/functional/legacy/045_folding_spec.lua index 6ca1176aea..1e5239ceac 100644 --- a/test/functional/legacy/045_folding_spec.lua +++ b/test/functional/legacy/045_folding_spec.lua @@ -14,9 +14,6 @@ describe('folding', function() screen = Screen.new(20, 8) screen:attach() end) - after_each(function() - screen:detach() - end) it('creation, opening, moving (to the end) and closing', function() insert([[ diff --git a/test/functional/legacy/063_match_and_matchadd_spec.lua b/test/functional/legacy/063_match_and_matchadd_spec.lua index 518d79861b..a4f5d6ac5b 100644 --- a/test/functional/legacy/063_match_and_matchadd_spec.lua +++ b/test/functional/legacy/063_match_and_matchadd_spec.lua @@ -14,6 +14,10 @@ describe('063: Test for ":match", "matchadd()" and related functions', function( it('is working', function() local screen = Screen.new(40, 5) screen:attach() + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, + [1] = {background = Screen.colors.Red}, + }) -- Check that "matcharg()" returns the correct group and pattern if a match -- is defined. @@ -126,22 +130,22 @@ describe('063: Test for ":match", "matchadd()" and related functions', function( command("call matchaddpos('MyGroup1', [[1, 5], [1, 8, 3]], 10, 3)") screen:expect([[ abcd{1:e}fg{1:hij}klmnop^q | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]], {[1] = {background = Screen.colors.Red}}, {{bold = true, foreground = Screen.colors.Blue}}) + ]]) command("call clearmatches()") command("call setline(1, 'abcdΣabcdef')") command("call matchaddpos('MyGroup1', [[1, 4, 2], [1, 9, 2]])") screen:expect([[ abc{1:dΣ}ab{1:cd}e^f | - ~ | - ~ | - ~ | + {0:~ }| + {0:~ }| + {0:~ }| | - ]],{[1] = {background = Screen.colors.Red}}, {{bold = true, foreground = Screen.colors.Blue}}) + ]]) end) end) diff --git a/test/functional/legacy/077_mf_hash_grow_spec.lua b/test/functional/legacy/077_mf_hash_grow_spec.lua deleted file mode 100644 index 4719a3ecbf..0000000000 --- a/test/functional/legacy/077_mf_hash_grow_spec.lua +++ /dev/null @@ -1,52 +0,0 @@ --- Inserts 2 million lines with consecutive integers starting from 1 --- (essentially, the output of GNU's seq 1 2000000), writes them to Xtest --- and calculates its cksum. --- We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess --- up the lines the checksum would differ. --- cksum is part of POSIX and so should be available on most Unixes. --- If it isn't available then the test will be skipped. - -local helpers = require('test.functional.helpers')(after_each) - -local feed = helpers.feed -local wait = helpers.wait -local clear = helpers.clear -local expect = helpers.expect -local command = helpers.command - -describe('mf_hash_grow()', function() - setup(clear) - - -- Check to see if cksum exists, otherwise skip the test - local null = helpers.iswin() and 'nul' or '/dev/null' - if os.execute('cksum --help >' .. null .. ' 2>&1') ~= 0 then - pending('was not tested because cksum was not found', function() end) - else - it('is working', function() - command('set fileformat=unix undolevels=-1') - - -- Fill the buffer with numbers 1 - 2000000 - command('let i = 1') - command('while i <= 2000000 | call append(i, range(i, i + 99)) | let i += 100 | endwhile') - - -- Delete empty first line, save to Xtest, and clear buffer - feed('ggdd<cr>') - wait() - command('w! Xtest') - feed('ggdG<cr>') - wait() - - -- Calculate the cksum of Xtest and delete first line - command('r !cksum Xtest') - feed('ggdd<cr>') - - -- Assert correct output of cksum. - expect([[ - 3678979763 14888896 Xtest]]) - end) - end - - teardown(function() - os.remove('Xtest') - end) -end) diff --git a/test/functional/legacy/084_curswant_spec.lua b/test/functional/legacy/084_curswant_spec.lua deleted file mode 100644 index 42cb2fc56d..0000000000 --- a/test/functional/legacy/084_curswant_spec.lua +++ /dev/null @@ -1,49 +0,0 @@ --- Tests for curswant not changing when setting an option. - -local helpers = require('test.functional.helpers')(after_each) -local insert, source = helpers.insert, helpers.source -local clear, expect = helpers.clear, helpers.expect - -describe('curswant', function() - setup(clear) - - -- luacheck: ignore 621 (Indentation) - it('is working', function() - insert([[ - start target options - tabstop - timeoutlen - ttimeoutlen - end target options]]) - - source([[ - /^start target options$/+1,/^end target options$/-1 yank - let target_option_names = split(@0) - function TestCurswant(option_name) - normal! ggf8j - let curswant_before = winsaveview().curswant - execute 'let' '&'.a:option_name '=' '&'.a:option_name - let curswant_after = winsaveview().curswant - return [a:option_name, curswant_before, curswant_after] - endfunction - - new - put =['1234567890', '12345'] - 1 delete _ - let result = [] - for option_name in target_option_names - call add(result, TestCurswant(option_name)) - endfor - - new - put =map(copy(result), 'join(v:val, '' '')') - 1 delete _ - ]]) - - -- Assert buffer contents. - expect([[ - tabstop 7 4 - timeoutlen 7 7 - ttimeoutlen 7 7]]) - end) -end) diff --git a/test/functional/legacy/098_scrollbind_spec.lua b/test/functional/legacy/098_scrollbind_spec.lua deleted file mode 100644 index d22aefdcbc..0000000000 --- a/test/functional/legacy/098_scrollbind_spec.lua +++ /dev/null @@ -1,48 +0,0 @@ --- Test for 'scrollbind' causing an unexpected scroll of one of the windows. - -local helpers = require('test.functional.helpers')(after_each) -local source = helpers.source -local clear, expect = helpers.clear, helpers.expect - -describe('scrollbind', function() - setup(clear) - - it('is working', function() - source([[ - set laststatus=0 - let g:totalLines = &lines * 20 - let middle = g:totalLines / 2 - wincmd n - wincmd o - for i in range(1, g:totalLines) - call setline(i, 'LINE ' . i) - endfor - exe string(middle) - normal zt - normal M - aboveleft vert new - for i in range(1, g:totalLines) - call setline(i, 'line ' . i) - endfor - exe string(middle) - normal zt - normal M - setl scb | wincmd p - setl scb - wincmd w - let topLineLeft = line('w0') - wincmd p - let topLineRight = line('w0') - setl noscrollbind - wincmd p - setl noscrollbind - q! - %del _ - call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight)) - brewind - ]]) - - -- Assert buffer contents. - expect("Difference between the top lines (left - right): 0") - end) -end) diff --git a/test/functional/legacy/104_let_assignment_spec.lua b/test/functional/legacy/104_let_assignment_spec.lua deleted file mode 100644 index a03bb026f6..0000000000 --- a/test/functional/legacy/104_let_assignment_spec.lua +++ /dev/null @@ -1,54 +0,0 @@ --- Tests for :let. - -local helpers = require('test.functional.helpers')(after_each) -local clear, source = helpers.clear, helpers.source -local command, expect = helpers.command, helpers.expect - -describe(':let', function() - setup(clear) - - it('is working', function() - command('set runtimepath+=test/functional/fixtures') - - -- Test to not autoload when assigning. It causes internal error. - source([[ - try - let Test104#numvar = function('tr') - $put ='OK: ' . string(Test104#numvar) - catch - $put ='FAIL: ' . v:exception - endtry - let a = 1 - let b = 2 - for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}'] - try - redir => messages - execute 'let' letargs - redir END - $put ='OK:' - $put =split(substitute(messages, '\n', '\0 ', 'g'), '\n') - catch - $put ='FAIL: ' . v:exception - redir END - endtry - endfor]]) - - -- Remove empty line - command('1d') - - -- Assert buffer contents. - expect([[ - OK: function('tr') - OK: - a #1 - b #2 - OK: - b #2 - OK: - b #2 - a #1 - OK: - a #1 - b #2]]) - end) -end) diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua index 8df2d89b70..3cb5d97869 100644 --- a/test/functional/legacy/assert_spec.lua +++ b/test/functional/legacy/assert_spec.lua @@ -3,6 +3,7 @@ local nvim, call = helpers.meths, helpers.call local clear, eq = helpers.clear, helpers.eq local source, command = helpers.source, helpers.command local exc_exec = helpers.exc_exec +local eval = helpers.eval local function expected_errors(errors) eq(errors, nvim.get_vvar('errors')) @@ -47,18 +48,18 @@ describe('assert function:', function() end) it('should not change v:errors when expected is equal to actual', function() - call('assert_equal', '', '') - call('assert_equal', 'string', 'string') + eq(0, call('assert_equal', '', '')) + eq(0, call('assert_equal', 'string', 'string')) expected_empty() end) it('should change v:errors when expected is not equal to actual', function() - call('assert_equal', 0, {0}) + eq(1, call('assert_equal', 0, {0})) expected_errors({'Expected 0 but got [0]'}) end) it('should change v:errors when expected is not equal to actual', function() - call('assert_equal', 0, "0") + eq(1, call('assert_equal', 0, "0")) expected_errors({"Expected 0 but got '0'"}) end) @@ -96,13 +97,13 @@ describe('assert function:', function() -- assert_notequal({expected}, {actual}[, {msg}]) describe('assert_notequal', function() it('should not change v:errors when expected differs from actual', function() - call('assert_notequal', 'foo', 4) - call('assert_notequal', {1, 2, 3}, 'foo') + eq(0, call('assert_notequal', 'foo', 4)) + eq(0, call('assert_notequal', {1, 2, 3}, 'foo')) expected_empty() end) it('should change v:errors when expected is equal to actual', function() - call('assert_notequal', 'foo', 'foo') + eq(1, call('assert_notequal', 'foo', 'foo')) expected_errors({"Expected not equal to 'foo'"}) end) end) @@ -110,13 +111,13 @@ describe('assert function:', function() -- assert_false({actual}, [, {msg}]) describe('assert_false', function() it('should not change v:errors when actual is false', function() - call('assert_false', 0) - call('assert_false', false) + eq(0, call('assert_false', 0)) + eq(0, call('assert_false', false)) expected_empty() end) it('should change v:errors when actual is not false', function() - call('assert_false', 1) + eq(1, call('assert_false', 1)) expected_errors({'Expected False but got 1'}) end) @@ -129,14 +130,14 @@ describe('assert function:', function() -- assert_true({actual}, [, {msg}]) describe('assert_true', function() it('should not change v:errors when actual is true', function() - call('assert_true', 1) - call('assert_true', -1) -- In Vim script, non-zero Numbers are TRUE. - call('assert_true', true) + eq(0, call('assert_true', 1)) + eq(0, call('assert_true', -1)) -- In Vim script, non-zero Numbers are TRUE. + eq(0, call('assert_true', true)) expected_empty() end) it('should change v:errors when actual is not true', function() - call('assert_true', 1.5) + eq(1, call('assert_true', 1.5)) expected_errors({'Expected True but got 1.5'}) end) end) @@ -233,20 +234,31 @@ describe('assert function:', function() -- assert_fails({cmd}, [, {error}]) describe('assert_fails', function() it('should change v:errors when error does not match v:errmsg', function() - command([[call assert_fails('xxx', {})]]) + eq(1, eval([[assert_fails('xxx', {})]])) command([[call assert_match("Expected {} but got 'E731:", v:errors[0])]]) expected_errors({"Expected {} but got 'E731: using Dictionary as a String'"}) end) it('should not change v:errors when cmd errors', function() - call('assert_fails', 'NonexistentCmd') + eq(0, eval([[assert_fails('NonexistentCmd')]])) expected_empty() end) it('should change v:errors when cmd succeeds', function() - call('assert_fails', 'call empty("")') + eq(1, eval([[assert_fails('call empty("")', '')]])) expected_errors({'command did not fail: call empty("")'}) end) + + it('can specify and get a message about what failed', function() + eq(1, eval([[assert_fails('xxx', {}, 'stupid')]])) + command([[call assert_match("stupid: Expected {} but got 'E731:", v:errors[0])]]) + expected_errors({"stupid: Expected {} but got 'E731: using Dictionary as a String'"}) + end) + + it('can specify and get a message even when cmd succeeds', function() + eq(1, eval([[assert_fails('echo', '', 'echo command')]])) + expected_errors({'command did not fail: echo command'}) + end) end) -- assert_inrange({lower}, {upper}, {actual}[, {msg}]) @@ -277,7 +289,7 @@ describe('assert function:', function() -- assert_report({msg}) describe('assert_report()', function() it('should add a message to v:errors', function() - command("call assert_report('something is wrong')") + eq(1, call('assert_report', 'something is wrong')) command("call assert_match('something is wrong', v:errors[0])") command('call remove(v:errors, 0)') expected_empty() @@ -291,7 +303,7 @@ describe('assert function:', function() try nocommand catch - call assert_exception('E492') + call assert_equal(0, assert_exception('E492')) endtry ]]) expected_empty() @@ -304,9 +316,9 @@ describe('assert function:', function() catch try " illegal argument, get NULL for error - call assert_exception([]) + call assert_equal(1, assert_exception([])) catch - call assert_exception('E730') + call assert_equal(0, assert_exception('E730')) endtry endtry ]]) diff --git a/test/functional/legacy/breakindent_spec.lua b/test/functional/legacy/breakindent_spec.lua deleted file mode 100644 index fd25e809e0..0000000000 --- a/test/functional/legacy/breakindent_spec.lua +++ /dev/null @@ -1,214 +0,0 @@ --- Test for breakindent - -local helpers = require('test.functional.helpers')(after_each) -local feed, insert = helpers.feed, helpers.insert -local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect - -describe('breakindent', function() - setup(clear) - - -- luacheck: ignore 621 (Indentation) - -- luacheck: ignore 613 (Trailing whitespace in a string) - -- luacheck: ignore 611 (Line contains only whitespaces) - it('is working', function() - insert('dummy text') - - feed_command('set wildchar=^E') - feed_command('10new') - feed_command('vsp') - feed_command('vert resize 20') - feed_command([[put =\"\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\"]]) - feed_command('set ts=4 sw=4 sts=4 breakindent') - feed_command('fu! ScreenChar(line, width)') - feed_command(' let c=""') - feed_command(' for i in range(1,a:width)') - feed_command(' let c.=nr2char(screenchar(a:line, i))') - feed_command(' endfor') - feed_command([[ let c.="\n"]]) - feed_command(' for i in range(1,a:width)') - feed_command(' let c.=nr2char(screenchar(a:line+1, i))') - feed_command(' endfor') - feed_command([[ let c.="\n"]]) - feed_command(' for i in range(1,a:width)') - feed_command(' let c.=nr2char(screenchar(a:line+2, i))') - feed_command(' endfor') - feed_command(' return c') - feed_command('endfu') - feed_command('fu DoRecordScreen()') - feed_command(' wincmd l') - feed_command([[ $put =printf(\"\n%s\", g:test)]]) - feed_command(' $put =g:line1') - feed_command(' wincmd p') - feed_command('endfu') - feed_command('set briopt=min:0') - feed_command('let g:test="Test 1: Simple breakindent"') - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - feed_command('let g:test="Test 2: Simple breakindent + sbr=>>"') - feed_command('set sbr=>>') - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - feed_command('let g:test ="Test 3: Simple breakindent + briopt:sbr"') - feed_command('set briopt=sbr,min:0 sbr=++') - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - feed_command('let g:test ="Test 4: Simple breakindent + min width: 18"') - feed_command('set sbr= briopt=min:18') - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - feed_command('let g:test =" Test 5: Simple breakindent + shift by 2"') - feed_command('set briopt=shift:2,min:0') - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - feed_command('let g:test=" Test 6: Simple breakindent + shift by -1"') - feed_command('set briopt=shift:-1,min:0') - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - feed_command('let g:test=" Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr"') - feed_command('set briopt=shift:1,sbr,min:0 nu sbr=? nuw=4') - feed_command('let line1=ScreenChar(line("."),10)') - feed_command('call DoRecordScreen()') - feed_command('let g:test=" Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr"') - feed_command('set briopt=shift:1,sbr,min:0 nu sbr=# list lcs&vi') - feed_command('let line1=ScreenChar(line("."),10)') - feed_command('call DoRecordScreen()') - feed_command([[let g:test=" Test 9: breakindent + shift by +1 + 'nu' + sbr=# list"]]) - feed_command('set briopt-=sbr') - feed_command('let line1=ScreenChar(line("."),10)') - feed_command('call DoRecordScreen()') - feed_command([[let g:test=" Test 10: breakindent + shift by +1 + 'nu' + sbr=~ cpo+=n"]]) - feed_command('set cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0') - feed_command('let line1=ScreenChar(line("."),10)') - feed_command('call DoRecordScreen()') - feed_command('wincmd p') - feed_command([[let g:test="\n Test 11: strdisplaywidth when breakindent is on"]]) - feed_command('set cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4') - -- Skip leading tab when calculating text width. - feed_command('let text=getline(2)') - -- Text wraps 3 times. - feed_command('let width = strlen(text[1:])+indent(2)*4+strlen(&sbr)*3') - feed_command('$put =g:test') - feed_command([[$put =printf(\"strdisplaywidth: %d == calculated: %d\", strdisplaywidth(text), width)]]) - feed_command([[let g:str="\t\t\t\t\t{"]]) - feed_command('let g:test=" Test 12: breakindent + long indent"') - feed_command('wincmd p') - feed_command('set all& breakindent linebreak briopt=min:10 nu numberwidth=3 ts=4') - feed_command('$put =g:str') - feed('zt') - feed_command('let line1=ScreenChar(1,10)') - feed_command('wincmd p') - feed_command('call DoRecordScreen()') - - -- Test, that the string " a\tb\tc\td\te" is correctly displayed in a - -- 20 column wide window (see bug report - -- https://groups.google.com/d/msg/vim_dev/ZOdg2mc9c9Y/TT8EhFjEy0IJ ). - feed_command('only') - feed_command('vert 20new') - feed_command('set all& breakindent briopt=min:10') - feed_command([[call setline(1, [" a\tb\tc\td\te", " z y x w v"])]]) - feed_command([[/^\s*a]]) - feed('fbgjyl') - feed_command('let line1 = @0') - feed_command([[?^\s*z]]) - feed('fygjyl') - feed_command('let line2 = @0') - feed_command('quit!') - feed_command([[$put ='Test 13: breakindent with wrapping Tab']]) - feed_command('$put =line1') - feed_command('$put =line2') - - feed_command('let g:test="Test 14: breakindent + visual blockwise delete #1"') - feed_command('set all& breakindent shada+=nX-test-breakindent.shada') - feed_command('30vnew') - feed_command('normal! 3a1234567890') - feed_command('normal! a abcde') - feed_command([[exec "normal! 0\<C-V>tex"]]) - feed_command('let line1=ScreenChar(line("."),8)') - feed_command('call DoRecordScreen()') - - feed_command('let g:test="Test 15: breakindent + visual blockwise delete #2"') - feed_command('%d') - feed_command('normal! 4a1234567890') - feed_command([[exec "normal! >>\<C-V>3f0x"]]) - feed_command('let line1=ScreenChar(line("."),20)') - feed_command('call DoRecordScreen()') - feed_command('quit!') - - -- Assert buffer contents. - expect([[ - - abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP - - Test 1: Simple breakindent - abcd - qrst - GHIJ - - Test 2: Simple breakindent + sbr=>> - abcd - >>qr - >>EF - - Test 3: Simple breakindent + briopt:sbr - abcd - ++ qrst - ++ GHIJ - - Test 4: Simple breakindent + min width: 18 - abcd - qrstuv - IJKLMN - - Test 5: Simple breakindent + shift by 2 - abcd - qr - EF - - Test 6: Simple breakindent + shift by -1 - abcd - qrstu - HIJKL - - Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr - 2 ab - ? m - ? x - - Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr - 2 ^Iabcd - # opq - # BCD - - Test 9: breakindent + shift by +1 + 'nu' + sbr=# list - 2 ^Iabcd - #op - #AB - - Test 10: breakindent + shift by +1 + 'nu' + sbr=~ cpo+=n - 2 ab - ~ mn - ~ yz - - Test 11: strdisplaywidth when breakindent is on - strdisplaywidth: 46 == calculated: 64 - { - - Test 12: breakindent + long indent - 56 - - ~ - Test 13: breakindent with wrapping Tab - d - w - - Test 14: breakindent + visual blockwise delete #1 - e - ~ - ~ - - Test 15: breakindent + visual blockwise delete #2 - 1234567890 - ~ - ~ ]]) - end) -end) diff --git a/test/functional/legacy/delete_spec.lua b/test/functional/legacy/delete_spec.lua index 9ea3269828..f2ced8942d 100644 --- a/test/functional/legacy/delete_spec.lua +++ b/test/functional/legacy/delete_spec.lua @@ -56,7 +56,7 @@ describe('Test for delete()', function() endif ]]) if eval('v:shell_error') ~= 0 then - pending('Cannot create symlink', function()end) + pending('Cannot create symlink') end -- Delete the link, not the file eq(0, eval("delete('Xlink')")) diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 3ed06a22e7..a207b176d3 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -17,7 +17,10 @@ describe('search cmdline', function() screen = Screen.new(20, 3) screen:attach() screen:set_default_attr_ids({ - inc = {reverse = true} + inc = {reverse = true}, + err = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, + more = { bold = true, foreground = Screen.colors.SeaGreen4 }, + tilde = { bold = true, foreground = Screen.colors.Blue1 }, }) end) @@ -404,15 +407,7 @@ describe('search cmdline', function() end) it('keeps the view after deleting a char from the search', function() - screen:detach() - screen = Screen.new(20, 6) - screen:attach() - screen:set_default_attr_ids({ - inc = {reverse = true} - }) - screen:set_default_attr_ignore({ - {bold=true, reverse=true}, {bold=true, foreground=Screen.colors.Blue1} - }) + screen:try_resize(20, 6) tenlines() feed('/foo') @@ -448,14 +443,7 @@ describe('search cmdline', function() end) it('restores original view after failed search', function() - screen:detach() - screen = Screen.new(40, 3) - screen:attach() - screen:set_default_attr_ids({ - inc = {reverse = true}, - err = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, - more = { bold = true, foreground = Screen.colors.SeaGreen4 }, - }) + screen:try_resize(40, 3) tenlines() feed('0') feed('/foo') @@ -484,15 +472,7 @@ describe('search cmdline', function() it("CTRL-G with 'incsearch' and ? goes in the right direction", function() -- oldtest: Test_search_cmdline4(). - screen:detach() - screen = Screen.new(40, 4) - screen:attach() - screen:set_default_attr_ids({ - inc = {reverse = true}, - err = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, - more = { bold = true, foreground = Screen.colors.SeaGreen4 }, - tilde = { bold = true, foreground = Screen.colors.Blue1 }, - }) + screen:try_resize(40, 4) command('enew!') funcs.setline(1, {' 1 the first', ' 2 the second', ' 3 the third'}) command('set laststatus=0 shortmess+=s') |