Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 19826:293a22b677a8 v8.2.0469
patch 8.2.0469: Vim9: no error for missing ] after list
Commit: https://github.com/vim/vim/commit/ee619e5bc0992e818f2d9540b093b769b9c27651
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 28 21:38:06 2020 +0100
patch 8.2.0469: Vim9: no error for missing ] after list
Problem: Vim9: no error for missing ] after list.
Solution: Add error message. Add more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 28 Mar 2020 21:45:06 +0100 |
parents | fc3cdc819d80 |
children | e4ade28bfaf7 |
comparison
equal
deleted
inserted
replaced
19825:17feab93763a | 19826:293a22b677a8 |
---|---|
804 call CheckDefFailure("let x = +'xx'", "E1030:") | 804 call CheckDefFailure("let x = +'xx'", "E1030:") |
805 | 805 |
806 call CheckDefFailure("let x = @", "E1002:") | 806 call CheckDefFailure("let x = @", "E1002:") |
807 call CheckDefFailure("let x = @<", "E354:") | 807 call CheckDefFailure("let x = @<", "E354:") |
808 | 808 |
809 call CheckDefFailure("let x = [1, 2", "E697:") | |
810 call CheckDefFailure("let x = [notfound]", "E1001:") | |
811 | |
812 call CheckDefFailure("let x = { -> 123) }", "E451:") | |
813 call CheckDefFailure("let x = 123->{x -> x + 5) }", "E451:") | |
814 | |
809 call CheckDefFailure("let x = ¬exist", 'E113:') | 815 call CheckDefFailure("let x = ¬exist", 'E113:') |
810 call CheckDefExecFailure("&grepprg = [343]", 'E1051:') | 816 call CheckDefExecFailure("&grepprg = [343]", 'E1051:') |
811 | 817 |
812 call CheckDefExecFailure("echo s:doesnt_exist", 'E121:') | 818 call CheckDefExecFailure("echo s:doesnt_exist", 'E121:') |
813 call CheckDefExecFailure("echo g:doesnt_exist", 'E121:') | 819 call CheckDefExecFailure("echo g:doesnt_exist", 'E121:') |
876 assert_equal(123, d.key) | 882 assert_equal(123, d.key) |
877 enddef | 883 enddef |
878 | 884 |
879 func Test_expr7_trailing_fails() | 885 func Test_expr7_trailing_fails() |
880 call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107') | 886 call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107') |
887 call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)} ()'], 'E274') | |
881 endfunc | 888 endfunc |
882 | 889 |
883 func Test_expr_fails() | 890 func Test_expr_fails() |
884 call CheckDefFailure("let x = '1'is2", 'E488:') | 891 call CheckDefFailure("let x = '1'is2", 'E488:') |
885 call CheckDefFailure("let x = '1'isnot2", 'E488:') | 892 call CheckDefFailure("let x = '1'isnot2", 'E488:') |