comparison src/testdir/test_viminfo.vim @ 10285:cd16ef948ad1 v8.0.0039

commit https://github.com/vim/vim/commit/156919f99afd1ac11d19d4270afbc1afb7245640 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 15 20:46:20 2016 +0200 patch 8.0.0039 Problem: When Vim 8 reads an old viminfo and exits, the next time marks are not read from viminfo. (Ned Batchelder) Solution: Set a mark when it wasn't set before, even when the timestamp is zero. (closes #1170)
author Christian Brabandt <cb@256bit.org>
date Sat, 15 Oct 2016 21:00:04 +0200
parents baad324e9fbc
children 1c4ebbae41d2
comparison
equal deleted inserted replaced
10284:dc7f7a0a1ed4 10285:cd16ef948ad1
1 " Test for reading and writing .viminfo 1 " Test for reading and writing .viminfo
2 2
3 function Test_read_and_write() 3 function Test_viminfo_read_and_write()
4 call histdel(':') 4 call histdel(':')
5 let lines = [ 5 let lines = [
6 \ '# comment line', 6 \ '# comment line',
7 \ '*encoding=utf-8', 7 \ '*encoding=utf-8',
8 \ '~MSle0~/asdf', 8 \ '~MSle0~/asdf',
15 15
16 wviminfo Xviminfo 16 wviminfo Xviminfo
17 let lines = readfile('Xviminfo') 17 let lines = readfile('Xviminfo')
18 let done = 0 18 let done = 0
19 for line in lines 19 for line in lines
20 if line[0] == '|' && line !~ '^|[234],' 20 if line[0] == '|' && line !~ '^|[234],' && line !~ '^|<'
21 if done == 0 21 if done == 0
22 call assert_equal('|1,4', line) 22 call assert_equal('|1,4', line)
23 elseif done == 1 23 elseif done == 1
24 call assert_equal('|copied as-is', line) 24 call assert_equal('|copied as-is', line)
25 elseif done == 2 25 elseif done == 2
467 467
468 call delete('Xviminfo') 468 call delete('Xviminfo')
469 silent! bwipe Xtestfileintab 469 silent! bwipe Xtestfileintab
470 endfunc 470 endfunc
471 471
472 func Test_oldfiles() 472 func Test_viminfo_file_mark_zero_time()
473 let lines = [
474 \ '# Viminfo version',
475 \ '|1,4',
476 \ '',
477 \ '*encoding=utf-8',
478 \ '',
479 \ '# File marks:',
480 \ "'B 1 0 /tmp/nothing",
481 \ '|4,66,1,0,0,"/tmp/nothing"',
482 \ "",
483 \ ]
484 call writefile(lines, 'Xviminfo')
485 delmark B
486 rviminfo Xviminfo
487 call delete('Xviminfo')
488 call assert_equal(1, line("'B"))
489 delmark B
490 endfunc
491
492 func Test_viminfo_oldfiles()
473 let v:oldfiles = [] 493 let v:oldfiles = []
474 let lines = [ 494 let lines = [
475 \ '# comment line', 495 \ '# comment line',
476 \ '*encoding=utf-8', 496 \ '*encoding=utf-8',
477 \ '', 497 \ '',