Mercurial > vim
comparison src/testdir/test_swap.vim @ 18017:988e5a868b60 v8.1.2004
patch 8.1.2004: more functions can be used as methods
Commit: https://github.com/vim/vim/commit/f6ed61e1489e40eada55a4f1782e1ed82bcad7d9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 7 19:05:09 2019 +0200
patch 8.1.2004: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make various functions usable as a method.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 Sep 2019 19:15:04 +0200 |
parents | b52ea9c5f1db |
children | f6dcf7eabd26 |
comparison
equal
deleted
inserted
replaced
18016:834b7854aa3c | 18017:988e5a868b60 |
---|---|
109 new Xswapinfo | 109 new Xswapinfo |
110 call setline(1, ['one', 'two', 'three']) | 110 call setline(1, ['one', 'two', 'three']) |
111 w | 111 w |
112 let fname = s:swapname() | 112 let fname = s:swapname() |
113 call assert_match('Xswapinfo', fname) | 113 call assert_match('Xswapinfo', fname) |
114 let info = swapinfo(fname) | 114 let info = fname->swapinfo() |
115 | 115 |
116 let ver = printf('VIM %d.%d', v:version / 100, v:version % 100) | 116 let ver = printf('VIM %d.%d', v:version / 100, v:version % 100) |
117 call assert_equal(ver, info.version) | 117 call assert_equal(ver, info.version) |
118 | 118 |
119 call assert_match('\w', info.user) | 119 call assert_match('\w', info.user) |
151 | 151 |
152 new Xtest2 | 152 new Xtest2 |
153 let buf = bufnr('%') | 153 let buf = bufnr('%') |
154 let expected = s:swapname() | 154 let expected = s:swapname() |
155 wincmd p | 155 wincmd p |
156 call assert_equal(expected, swapname(buf)) | 156 call assert_equal(expected, buf->swapname()) |
157 | 157 |
158 new Xtest3 | 158 new Xtest3 |
159 setlocal noswapfile | 159 setlocal noswapfile |
160 call assert_equal('', swapname('%')) | 160 call assert_equal('', swapname('%')) |
161 | 161 |