comparison src/testdir/test_modeline.vim @ 24914:1186160ecf57 v8.2.2994

patch 8.2.2994: various code is not fully tested Commit: https://github.com/vim/vim/commit/2d6d718dde7163c971d37b8f4f1ed8f2d25de130 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Jun 13 21:52:48 2021 +0200 patch 8.2.2994: various code is not fully tested Problem: Various code is not fully tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8378)
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jun 2021 22:00:04 +0200
parents 08940efa6b4e
children 64fa341cc33b
comparison
equal deleted inserted replaced
24913:de12fb675362 24914:1186160ecf57
332 332
333 let &modeline = modeline 333 let &modeline = modeline
334 call delete('Xmodeline') 334 call delete('Xmodeline')
335 endfunc 335 endfunc
336 336
337 " Test for the 'modeline' default value in compatible and non-compatible modes
338 " for root and non-root accounts
339 func Test_modeline_default()
340 set compatible
341 call assert_false(&modeline)
342 set nocompatible
343 call assert_equal(IsRoot() ? 0 : 1, &modeline)
344 set compatible&vi
345 call assert_false(&modeline)
346 set compatible&vim
347 call assert_equal(IsRoot() ? 0 : 1, &modeline)
348 set compatible& modeline&
349 endfunc
350
351 " Some options cannot be set from the modeline when 'diff' option is set
352 func Test_modeline_diff_buffer()
353 call writefile(['vim: diff foldmethod=marker wrap'], 'Xfile')
354 set foldmethod& nowrap
355 new Xfile
356 call assert_equal('manual', &foldmethod)
357 call assert_false(&wrap)
358 set wrap&
359 call delete('Xfile')
360 bw
361 endfunc
362
337 " vim: shiftwidth=2 sts=2 expandtab 363 " vim: shiftwidth=2 sts=2 expandtab