comparison src/testdir/test_eval_stuff.vim @ 18080:a6d218f99ff7 v8.1.2035

patch 8.1.2035: recognizing octal numbers is confusing Commit: https://github.com/vim/vim/commit/60a8de28d11595f4df0419ece8afa7d6accc9fbd Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 15 14:33:22 2019 +0200 patch 8.1.2035: recognizing octal numbers is confusing Problem: Recognizing octal numbers is confusing. Solution: Introduce scriptversion 4: do not use octal and allow for single quote inside numbers.
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Sep 2019 14:45:04 +0200
parents 2029737e6a22
children 9d6832a5426f
comparison
equal deleted inserted replaced
18079:c4ca2f98e7b4 18080:a6d218f99ff7
72 72
73 func Test_readfile_binary() 73 func Test_readfile_binary()
74 new 74 new
75 call setline(1, ['one', 'two', 'three']) 75 call setline(1, ['one', 'two', 'three'])
76 setlocal ff=dos 76 setlocal ff=dos
77 write XReadfile 77 silent write XReadfile
78 let lines = 'XReadfile'->readfile() 78 let lines = 'XReadfile'->readfile()
79 call assert_equal(['one', 'two', 'three'], lines) 79 call assert_equal(['one', 'two', 'three'], lines)
80 let lines = readfile('XReadfile', '', 2) 80 let lines = readfile('XReadfile', '', 2)
81 call assert_equal(['one', 'two'], lines) 81 call assert_equal(['one', 'two'], lines)
82 let lines = readfile('XReadfile', 'b') 82 let lines = readfile('XReadfile', 'b')
122 let a = 'a' 122 let a = 'a'
123 let a..=b 123 let a..=b
124 call assert_equal('ab', a) 124 call assert_equal('ab', a)
125 endfunc 125 endfunc
126 126
127 " Test fix for issue #4507
128 func Test_skip_after_throw()
129 try
130 throw 'something'
131 let x = wincol() || &ts
132 catch /something/
133 endtry
134 endfunc
135
127 scriptversion 2 136 scriptversion 2
128 func Test_string_concat_scriptversion2() 137 func Test_string_concat_scriptversion2()
129 call assert_true(has('vimscript-2')) 138 call assert_true(has('vimscript-2'))
130 let a = 'a' 139 let a = 'a'
131 let b = 'b' 140 let b = 'b'
181 190
182 call assert_false(0 && l:x.foo) 191 call assert_false(0 && l:x.foo)
183 call assert_true(1 && l:x.foo) 192 call assert_true(1 && l:x.foo)
184 endfunc 193 endfunc
185 194
186 func Test_scriptversion() 195 scriptversion 4
196 func Test_vvar_scriptversion4()
197 call assert_equal(17, 017)
198 call assert_equal(18, 018)
199 call assert_equal(64, 0b1'00'00'00)
200 call assert_equal(1048576, 0x10'00'00)
201 call assert_equal(1000000, 1'000'000)
202 endfunc
203
204 scriptversion 1
205 func Test_vvar_scriptversion1()
206 call assert_equal(15, 017)
207 call assert_equal(18, 018)
208 endfunc
209
210 func Test_scriptversion_fail()
187 call writefile(['scriptversion 9'], 'Xversionscript') 211 call writefile(['scriptversion 9'], 'Xversionscript')
188 call assert_fails('source Xversionscript', 'E999:') 212 call assert_fails('source Xversionscript', 'E999:')
189 call delete('Xversionscript') 213 call delete('Xversionscript')
190 endfunc 214 endfunc
191
192 " Test fix for issue #4507
193 func Test_skip_after_throw()
194 try
195 throw 'something'
196 let x = wincol() || &ts
197 catch /something/
198 endtry
199 endfunc