Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 19558:8eeec8886c02 v8.2.0336
patch 8.2.0336: Vim9: insufficient test coverage for compiling
Commit: https://github.com/vim/vim/commit/42a480bf7243ea8bce498264911e187931d083e5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 29 23:23:47 2020 +0100
patch 8.2.0336: Vim9: insufficient test coverage for compiling
Problem: Vim9: insufficient test coverage for compiling.
Solution: Add more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 29 Feb 2020 23:30:04 +0100 |
parents | 860b39ed0e0b |
children | ba35daca6553 |
comparison
equal
deleted
inserted
replaced
19557:59821eacb2dd | 19558:8eeec8886c02 |
---|---|
4 | 4 |
5 " Check that "line" inside ":def" results in an "error" message. | 5 " Check that "line" inside ":def" results in an "error" message. |
6 func CheckDefFailure(line, error) | 6 func CheckDefFailure(line, error) |
7 call writefile(['def! Func()', a:line, 'enddef'], 'Xdef') | 7 call writefile(['def! Func()', a:line, 'enddef'], 'Xdef') |
8 call assert_fails('so Xdef', a:error, a:line) | 8 call assert_fails('so Xdef', a:error, a:line) |
9 call delete('Xdef') | |
10 endfunc | |
11 | |
12 func CheckDefFailureMult(lines, error) | |
13 call writefile(['def! Func()'] + a:lines + ['enddef'], 'Xdef') | |
14 call assert_fails('so Xdef', a:error, join(a:lines, ' | ')) | |
9 call delete('Xdef') | 15 call delete('Xdef') |
10 endfunc | 16 endfunc |
11 | 17 |
12 " Check that "line" inside ":def" results in an "error" message when executed. | 18 " Check that "line" inside ":def" results in an "error" message when executed. |
13 func CheckDefExecFailure(line, error) | 19 func CheckDefExecFailure(line, error) |
803 | 809 |
804 call CheckDefExecFailure("let x = +g:astring", 'E1030:') | 810 call CheckDefExecFailure("let x = +g:astring", 'E1030:') |
805 call CheckDefExecFailure("let x = +g:ablob", 'E974:') | 811 call CheckDefExecFailure("let x = +g:ablob", 'E974:') |
806 call CheckDefExecFailure("let x = +g:alist", 'E745:') | 812 call CheckDefExecFailure("let x = +g:alist", 'E745:') |
807 call CheckDefExecFailure("let x = +g:adict", 'E728:') | 813 call CheckDefExecFailure("let x = +g:adict", 'E728:') |
814 | |
815 call CheckDefFailureMult(["let x = ''", "let y = x.memb"], 'E715:') | |
808 endfunc | 816 endfunc |
809 | 817 |
810 let g:Funcrefs = [function('add')] | 818 let g:Funcrefs = [function('add')] |
811 | 819 |
812 func CallMe(arg) | 820 func CallMe(arg) |