comparison src/testdir/test_vim9_script.vim @ 19449:f8408ba21982 v8.2.0282

patch 8.2.0282: Vim9: setting number option not tested Commit: https://github.com/vim/vim/commit/401d9ffb5a8a40102c000c2d2614aa043f541f90 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 19 18:14:44 2020 +0100 patch 8.2.0282: Vim9: setting number option not tested Problem: Vim9: setting number option not tested. Solution: Add more tests. Fix assigning to global variable.
author Bram Moolenaar <Bram@vim.org>
date Wed, 19 Feb 2020 18:15:05 +0100
parents 6e27e1ffa2a6
children b26e96f7c12f
comparison
equal deleted inserted replaced
19448:d39989f46ad3 19449:f8408ba21982
27 call assert_equal('yes', SomeFunc()) 27 call assert_equal('yes', SomeFunc())
28 endfunc 28 endfunc
29 29
30 let s:appendToMe = 'xxx' 30 let s:appendToMe = 'xxx'
31 let s:addToMe = 111 31 let s:addToMe = 111
32 let g:existing = 'yes'
32 33
33 def Test_assignment() 34 def Test_assignment()
34 let bool1: bool = true 35 let bool1: bool = true
35 assert_equal(v:true, bool1) 36 assert_equal(v:true, bool1)
36 let bool2: bool = false 37 let bool2: bool = false
43 " let listS: list<string> = [] 44 " let listS: list<string> = []
44 " let listN: list<number> = [] 45 " let listN: list<number> = []
45 46
46 let dict1: dict<string> = #{key: 'value'} 47 let dict1: dict<string> = #{key: 'value'}
47 let dict2: dict<number> = #{one: 1, two: 2} 48 let dict2: dict<number> = #{one: 1, two: 2}
49
50 g:newvar = 'new'
51 assert_equal('new', g:newvar)
52
53 assert_equal('yes', g:existing)
54 g:existing = 'no'
55 assert_equal('no', g:existing)
48 56
49 v:char = 'abc' 57 v:char = 'abc'
50 assert_equal('abc', v:char) 58 assert_equal('abc', v:char)
51 59
52 $ENVVAR = 'foobar' 60 $ENVVAR = 'foobar'