Patch 8.2.0477
Problem: Vim9: error messages not tested.
Solution: Add more tests.
Files: src/testdir/test_vim9_expr.vim, src/vim9execute.c
*** ../vim-8.2.0476/src/testdir/test_vim9_expr.vim 2020-03-28
21:38:02.128802283 +0100
--- src/testdir/test_vim9_expr.vim 2020-03-29 18:38:30.433984482 +0200
***************
*** 728,733 ****
--- 728,740 ----
let val = 1
assert_equal(g:dict_one, {key: val})
+ call CheckDefFailure("let x = #{8: 8}", 'E1014:')
+ call CheckDefFailure("let x = #{xxx}", 'E720:')
+ call CheckDefFailure("let x = #{xxx: 1", 'E722:')
+ call CheckDefFailure("let x = #{xxx: 1,", 'E723:')
+ call CheckDefFailure("let x = {'a': xxx}", 'E1001:')
+ call CheckDefFailure("let x = {xxx: 8}", 'E1001:')
+ call CheckDefFailure("let x = #{a: 1, a: 2}", 'E721:')
call CheckDefExecFailure("let x = g:anint.member", 'E715:')
call CheckDefExecFailure("let x = g:dict_empty.member", 'E716:')
enddef
***************
*** 750,755 ****
--- 757,764 ----
" environment variable
assert_equal('testvar', $TESTVAR)
assert_equal('', $ASDF_ASD_XXX)
+
+ call CheckDefFailure("let x = $$$", 'E1002:')
enddef
def Test_expr7_register()
***************
*** 802,807 ****
--- 811,819 ----
call CheckDefFailure("let x = -'xx'", "E1030:")
call CheckDefFailure("let x = +'xx'", "E1030:")
+ call CheckDefFailure("let x = -0z12", "E974:")
+ call CheckDefExecFailure("let x = -[8]", "E39:")
+ call CheckDefExecFailure("let x = -{'a': 1}", "E39:")
call CheckDefFailure("let x = @", "E1002:")
call CheckDefFailure("let x = @<", "E354:")
*** ../vim-8.2.0476/src/vim9execute.c 2020-03-23 22:53:18.880838768 +0100
--- src/vim9execute.c 2020-03-29 18:37:35.362169943 +0200
***************
*** 1612,1618 ****
case ISN_NEGATENR:
tv = STACK_TV_BOT(-1);
! tv->vval.v_number = -tv->vval.v_number;
break;
case ISN_CHECKNR:
--- 1612,1632 ----
case ISN_NEGATENR:
tv = STACK_TV_BOT(-1);
! if (tv->v_type != VAR_NUMBER
! #ifdef FEAT_FLOAT
! && tv->v_type != VAR_FLOAT
! #endif
! )
! {
! emsg(_(e_number_exp));
! goto failed;
! }
! #ifdef FEAT_FLOAT
! if (tv->v_type == VAR_FLOAT)
! tv->vval.v_float = -tv->vval.v_float;
! else
! #endif
! tv->vval.v_number = -tv->vval.v_number;
break;
case ISN_CHECKNR:
*** ../vim-8.2.0476/src/version.c 2020-03-29 17:50:44.675192346 +0200
--- src/version.c 2020-03-29 18:39:47.169725738 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 477,
/**/
--
Q: What do you call a fish without an eye?
A: fsh!
Q: What do you call a deer with no eyes?
A: no eye deer.
Q: What do you call a deer with no eyes and no legs?
A: still no eye deer.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202003291641.02TGf3KS012508%40masaka.moolenaar.net.