2018-07-23 04:12:03 +02:00
|
|
|
" Tests for parsing the modeline.
|
|
|
|
|
2018-07-23 04:49:23 +02:00
|
|
|
func Test_modeline_invalid()
|
2018-11-03 19:06:25 +01:00
|
|
|
" This was reading allocated memory in the past.
|
2018-07-23 04:12:03 +02:00
|
|
|
call writefile(['vi:0', 'nothing'], 'Xmodeline')
|
2018-11-03 19:06:25 +01:00
|
|
|
let modeline = &modeline
|
|
|
|
set modeline
|
2018-07-23 04:12:03 +02:00
|
|
|
call assert_fails('split Xmodeline', 'E518:')
|
2018-11-03 19:06:25 +01:00
|
|
|
let &modeline = modeline
|
2018-07-23 04:12:03 +02:00
|
|
|
bwipe!
|
2018-07-24 04:51:20 +02:00
|
|
|
call delete('Xmodeline')
|
2018-07-23 04:12:03 +02:00
|
|
|
endfunc
|