comparison src/testdir/test_vim9_script.vim @ 19521:860b39ed0e0b v8.2.0318

patch 8.2.0318: Vim9: types not sufficiently tested Commit: https://github.com/vim/vim/commit/0c2ca58ef06ac49d40330bbe1ee70c3d8af7a648 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 25 22:58:29 2020 +0100 patch 8.2.0318: Vim9: types not sufficiently tested Problem: Vim9: types not sufficiently tested. Solution: Add tests with more types.
author Bram Moolenaar <Bram@vim.org>
date Tue, 25 Feb 2020 23:00:04 +0100
parents 7e76d5fba19f
children 3b026343f398
comparison
equal deleted inserted replaced
19520:fdd51c96d533 19521:860b39ed0e0b
35 let bool1: bool = true 35 let bool1: bool = true
36 assert_equal(v:true, bool1) 36 assert_equal(v:true, bool1)
37 let bool2: bool = false 37 let bool2: bool = false
38 assert_equal(v:false, bool2) 38 assert_equal(v:false, bool2)
39 39
40 let list1: list<string> = ['sdf', 'asdf'] 40 let list1: list<bool> = [false, true, false]
41 let list2: list<number> = [1, 2, 3] 41 let list2: list<number> = [1, 2, 3]
42 let list3: list<string> = ['sdf', 'asdf']
43 let list4: list<any> = ['yes', true, 1234]
44 let list5: list<blob> = [0z01, 0z02]
42 45
43 let listS: list<string> = [] 46 let listS: list<string> = []
44 let listN: list<number> = [] 47 let listN: list<number> = []
45 48
46 let dict1: dict<string> = #{key: 'value'} 49 let dict1: dict<bool> = #{one: false, two: true}
47 let dict2: dict<number> = #{one: 1, two: 2} 50 let dict2: dict<number> = #{one: 1, two: 2}
51 let dict3: dict<string> = #{key: 'value'}
52 let dict4: dict<any> = #{one: 1, two: '2'}
53 let dict5: dict<blob> = #{one: 0z01, tw: 0z02}
48 54
49 g:newvar = 'new' 55 g:newvar = 'new'
50 assert_equal('new', g:newvar) 56 assert_equal('new', g:newvar)
51 57
52 assert_equal('yes', g:existing) 58 assert_equal('yes', g:existing)