comparison src/testdir/test_functions.vim @ 14487:336213a840d9 v8.1.0257

patch 8.1.0257: no test for pathshorten() commit https://github.com/vim/vim/commit/bfde0b482d25db43e9fc5a35c771b859b1eb8828 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 8 22:27:31 2018 +0200 patch 8.1.0257: no test for pathshorten() Problem: No test for pathshorten(). Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/3295)
author Christian Brabandt <cb@256bit.org>
date Wed, 08 Aug 2018 22:30:05 +0200
parents 06316dbd66bc
children 23d6d9e9ae3e
comparison
equal deleted inserted replaced
14486:4e34a56ce9ee 14487:336213a840d9
204 204
205 call assert_fails('call simplify({->0})', 'E729:') 205 call assert_fails('call simplify({->0})', 'E729:')
206 call assert_fails('call simplify([])', 'E730:') 206 call assert_fails('call simplify([])', 'E730:')
207 call assert_fails('call simplify({})', 'E731:') 207 call assert_fails('call simplify({})', 'E731:')
208 call assert_fails('call simplify(1.2)', 'E806:') 208 call assert_fails('call simplify(1.2)', 'E806:')
209 endfunc
210
211 func Test_pathshorten()
212 call assert_equal('', pathshorten(''))
213 call assert_equal('foo', pathshorten('foo'))
214 call assert_equal('/foo', pathshorten('/foo'))
215 call assert_equal('f/', pathshorten('foo/'))
216 call assert_equal('f/bar', pathshorten('foo/bar'))
217 call assert_equal('f/b/foobar', pathshorten('foo/bar/foobar'))
218 call assert_equal('/f/b/foobar', pathshorten('/foo/bar/foobar'))
219 call assert_equal('.f/bar', pathshorten('.foo/bar'))
220 call assert_equal('~f/bar', pathshorten('~foo/bar'))
221 call assert_equal('~.f/bar', pathshorten('~.foo/bar'))
222 call assert_equal('.~f/bar', pathshorten('.~foo/bar'))
223 call assert_equal('~/f/bar', pathshorten('~/foo/bar'))
209 endfunc 224 endfunc
210 225
211 func Test_strpart() 226 func Test_strpart()
212 call assert_equal('de', strpart('abcdefg', 3, 2)) 227 call assert_equal('de', strpart('abcdefg', 3, 2))
213 call assert_equal('ab', strpart('abcdefg', -2, 4)) 228 call assert_equal('ab', strpart('abcdefg', -2, 4))