comparison src/testdir/test_search.vim @ 12560:44aa2997239d v8.0.1158

patch 8.0.1158: still old style tests commit https://github.com/vim/vim/commit/db51007108a6ab0671e7f7b4844557cbe647185f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 28 21:52:17 2017 +0200 patch 8.0.1158: still old style tests Problem: Still old style tests. Solution: Convert serveral tests to new style. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Sep 2017 22:00:05 +0200
parents 80af4916eadc
children 1fad9675d8fd
comparison
equal deleted inserted replaced
12559:34c8ec888122 12560:44aa2997239d
354 " clean up 354 " clean up
355 set noincsearch 355 set noincsearch
356 call test_override("char_avail", 0) 356 call test_override("char_avail", 0)
357 bw! 357 bw!
358 endfunc 358 endfunc
359
360 " Tests for regexp with various magic settings
361 func Test_search_regexp()
362 enew!
363
364 put ='1 a aa abb abbccc'
365 exe 'normal! /a*b\{2}c\+/e' . "\<CR>"
366 call assert_equal([0, 2, 17, 0], getpos('.'))
367
368 put ='2 d dd dee deefff'
369 exe 'normal! /\Md\*e\{2}f\+/e' . "\<CR>"
370 call assert_equal([0, 3, 17, 0], getpos('.'))
371
372 set nomagic
373 put ='3 g gg ghh ghhiii'
374 exe 'normal! /g\*h\{2}i\+/e' . "\<CR>"
375 call assert_equal([0, 4, 17, 0], getpos('.'))
376
377 put ='4 j jj jkk jkklll'
378 exe 'normal! /\mj*k\{2}l\+/e' . "\<CR>"
379 call assert_equal([0, 5, 17, 0], getpos('.'))
380
381 put ='5 m mm mnn mnnooo'
382 exe 'normal! /\vm*n{2}o+/e' . "\<CR>"
383 call assert_equal([0, 6, 17, 0], getpos('.'))
384
385 put ='6 x ^aa$ x'
386 exe 'normal! /\V^aa$' . "\<CR>"
387 call assert_equal([0, 7, 5, 0], getpos('.'))
388
389 set magic
390 put ='7 (a)(b) abbaa'
391 exe 'normal! /\v(a)(b)\2\1\1/e' . "\<CR>"
392 call assert_equal([0, 8, 14, 0], getpos('.'))
393
394 put ='8 axx [ab]xx'
395 exe 'normal! /\V[ab]\(\[xy]\)\1' . "\<CR>"
396 call assert_equal([0, 9, 7, 0], getpos('.'))
397
398 set undolevels=100
399 put ='9 foobar'
400 put =''
401 exe "normal! a\<C-G>u\<Esc>"
402 normal G
403 exe 'normal! dv?bar?' . "\<CR>"
404 call assert_equal('9 foo', getline('.'))
405 call assert_equal([0, 10, 5, 0], getpos('.'))
406 call assert_equal(10, line('$'))
407 normal u
408 call assert_equal('9 foobar', getline('.'))
409 call assert_equal([0, 10, 6, 0], getpos('.'))
410 call assert_equal(11, line('$'))
411
412 set undolevels&
413 enew!
414 endfunc