comparison src/testdir/test_blob.vim @ 24450:3e1886f1e875 v8.2.2765

patch 8.2.2765: Vim9: not all blob operations work Commit: https://github.com/vim/vim/commit/0e3ff1919603ee4c4a347fdf761dbdbdeb068015 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 14 20:35:23 2021 +0200 patch 8.2.2765: Vim9: not all blob operations work Problem: Vim9: not all blob operations work. Solution: Run more tests also with Vim9 script and :def functions. Fix what doesn't work.
author Bram Moolenaar <Bram@vim.org>
date Wed, 14 Apr 2021 20:45:04 +0200
parents 602e528a8e43
children 96905804bf5a
comparison
equal deleted inserted replaced
24449:ca0d84e008e5 24450:3e1886f1e875
74 VAR m = deepcopy(l) 74 VAR m = deepcopy(l)
75 LET m[0] = 0z34 #" E742 or E741 should not occur. 75 LET m[0] = 0z34 #" E742 or E741 should not occur.
76 END 76 END
77 call CheckLegacyAndVim9Success(lines) 77 call CheckLegacyAndVim9Success(lines)
78 78
79 " TODO: move to above once it works 79 let lines =<< trim END
80 let b = 0zDEADBEEF 80 VAR b = 0zDEADBEEF
81 call assert_fails('let b[2 : 3] = 0z112233', 'E972:') 81 LET b[2 : 3] = 0z112233
82 call assert_fails('let b[2 : 3] = 0z11', 'E972:') 82 END
83 call assert_fails('let b[3 : 2] = 0z', 'E979:') 83 call CheckLegacyAndVim9Failure(lines, 'E972:')
84 84
85 call assert_fails('let b ..= 0z33', 'E734:') 85 let lines =<< trim END
86 call assert_fails('let b ..= "xx"', 'E734:') 86 VAR b = 0zDEADBEEF
87 call assert_fails('let b += "xx"', 'E734:') 87 LET b[2 : 3] = 0z11
88 call assert_fails('let b[1 : 1] ..= 0z55', 'E734:') 88 END
89 call CheckLegacyAndVim9Failure(lines, 'E972:')
90
91 let lines =<< trim END
92 VAR b = 0zDEADBEEF
93 LET b[3 : 2] = 0z
94 END
95 call CheckLegacyAndVim9Failure(lines, 'E979:')
96
97 let lines =<< trim END
98 VAR b = 0zDEADBEEF
99 LET b ..= 0z33
100 END
101 call CheckLegacyAndVim9Failure(lines, ['E734:', 'E1019:', 'E734:'])
102
103 let lines =<< trim END
104 VAR b = 0zDEADBEEF
105 LET b ..= "xx"
106 END
107 call CheckLegacyAndVim9Failure(lines, ['E734:', 'E1019:', 'E734:'])
108
109 let lines =<< trim END
110 VAR b = 0zDEADBEEF
111 LET b += "xx"
112 END
113 call CheckLegacyAndVim9Failure(lines, ['E734:', 'E1012:', 'E734:'])
114
115 let lines =<< trim END
116 VAR b = 0zDEADBEEF
117 LET b[1 : 1] ..= 0z55
118 END
119 call CheckLegacyAndVim9Failure(lines, ['E734:', 'E1183:', 'E734:'])
89 endfunc 120 endfunc
90 121
91 func Test_blob_get_range() 122 func Test_blob_get_range()
92 let b = 0z0011223344 123 let b = 0z0011223344
93 call assert_equal(0z2233, b[2:3]) 124 call assert_equal(0z2233, b[2:3])