Patch 8.2.0221
Problem: No test for Vim9 += and ..=.
Solution: Add tests.
Files: src/testdir/test_vim9_script.vim
*** ../vim-8.2.0220/src/testdir/test_vim9_script.vim 2020-02-05
22:55:44.772295287 +0100
--- src/testdir/test_vim9_script.vim 2020-02-06 13:14:55.947635483 +0100
***************
*** 27,32 ****
--- 27,35 ----
call assert_equal('yes', SomeFunc())
endfunc
+ let s:appendToMe = 'xxx'
+ let s:addToMe = 111
+
def Test_assignment()
let bool1: bool = true
assert_equal(v:true, bool1)
***************
*** 44,54 ****
let dict2: dict<number> = #{one: 1, two: 2}
v:char = 'abc'
! call assert_equal('abc', v:char)
$ENVVAR = 'foobar'
! call assert_equal('foobar', $ENVVAR)
$ENVVAR = ''
enddef
func Test_assignment_failure()
--- 47,62 ----
let dict2: dict<number> = #{one: 1, two: 2}
v:char = 'abc'
! assert_equal('abc', v:char)
$ENVVAR = 'foobar'
! assert_equal('foobar', $ENVVAR)
$ENVVAR = ''
+
+ appendToMe ..= 'yyy'
+ assert_equal('xxxyyy', appendToMe)
+ addToMe += 222
+ assert_equal(333, addToMe)
enddef
func Test_assignment_failure()
***************
*** 195,200 ****
--- 203,209 ----
export const CONST = 1234
export let exported = 9876
+ export let exp_name = 'John'
export def Exported(): string
return 'Exported'
enddef
***************
*** 205,211 ****
--- 214,227 ----
vim9script
import {exported, Exported} from './Xexport.vim'
g:imported = exported
+ exported += 3
+ g:imported_added = exported
g:imported_func = Exported()
+
+ import {exp_name} from './Xexport.vim'
+ g:imported_name = exp_name
+ exp_name ..= ' Doe'
+ g:imported_name_appended = exp_name
END
writefile(import_script_lines, 'Ximport.vim')
***************
*** 216,228 ****
--- 232,249 ----
assert_equal('bobbie', g:result)
assert_equal('bob', g:localname)
assert_equal(9876, g:imported)
+ assert_equal(9879, g:imported_added)
assert_equal('Exported', g:imported_func)
+ assert_equal('John', g:imported_name)
+ assert_equal('John Doe', g:imported_name_appended)
assert_false(exists('g:name'))
unlet g:result
unlet g:localname
unlet g:imported
+ unlet g:imported_added
unlet g:imported_func
+ unlet g:imported_name g:imported_name_appended
delete('Ximport.vim')
delete('Xexport.vim')
*** ../vim-8.2.0220/src/version.c 2020-02-06 11:54:31.107664148 +0100
--- src/version.c 2020-02-06 13:11:23.800356806 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 221,
/**/
--
Know this story about a nerd who fell into a river and drowned,
despite his cries of "F1! F1!"?
/// 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/202002061216.016CGPOo012300%40masaka.moolenaar.net.