Mercurial > vim
comparison src/testdir/test_vimscript.vim @ 11183:1c4ebbae41d2 v8.0.0478
patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
commit https://github.com/vim/vim/commit/37175409d766ce67f2548dffa6d73451379b5737
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 18 20:18:45 2017 +0100
patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
Problem: Tests use assert_true(0) and assert_false(1) to report errors.
Solution: Use assert_report().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 18 Mar 2017 20:30:04 +0100 |
parents | e05695e59f6d |
children | 251f1833db7d |
comparison
equal
deleted
inserted
replaced
11182:7e8032250657 | 11183:1c4ebbae41d2 |
---|---|
1254 \ 'append', | 1254 \ 'append', |
1255 \ 'py <<EOS', | 1255 \ 'py <<EOS', |
1256 \ '.', | 1256 \ '.', |
1257 \ ]) | 1257 \ ]) |
1258 catch | 1258 catch |
1259 call assert_false(1, "Can't define function") | 1259 call assert_report("Can't define function") |
1260 endtry | 1260 endtry |
1261 try | 1261 try |
1262 call DefineFunction('T_Append', [ | 1262 call DefineFunction('T_Append', [ |
1263 \ 'append', | 1263 \ 'append', |
1264 \ 'abc', | 1264 \ 'abc', |
1265 \ ]) | 1265 \ ]) |
1266 call assert_false(1, "Shouldn't be able to define function") | 1266 call assert_report("Shouldn't be able to define function") |
1267 catch | 1267 catch |
1268 call assert_exception('Vim(function):E126: Missing :endfunction') | 1268 call assert_exception('Vim(function):E126: Missing :endfunction') |
1269 endtry | 1269 endtry |
1270 | 1270 |
1271 " :change | 1271 " :change |
1274 \ 'change', | 1274 \ 'change', |
1275 \ 'py <<EOS', | 1275 \ 'py <<EOS', |
1276 \ '.', | 1276 \ '.', |
1277 \ ]) | 1277 \ ]) |
1278 catch | 1278 catch |
1279 call assert_false(1, "Can't define function") | 1279 call assert_report("Can't define function") |
1280 endtry | 1280 endtry |
1281 try | 1281 try |
1282 call DefineFunction('T_Change', [ | 1282 call DefineFunction('T_Change', [ |
1283 \ 'change', | 1283 \ 'change', |
1284 \ 'abc', | 1284 \ 'abc', |
1285 \ ]) | 1285 \ ]) |
1286 call assert_false(1, "Shouldn't be able to define function") | 1286 call assert_report("Shouldn't be able to define function") |
1287 catch | 1287 catch |
1288 call assert_exception('Vim(function):E126: Missing :endfunction') | 1288 call assert_exception('Vim(function):E126: Missing :endfunction') |
1289 endtry | 1289 endtry |
1290 | 1290 |
1291 " :insert | 1291 " :insert |
1294 \ 'insert', | 1294 \ 'insert', |
1295 \ 'py <<EOS', | 1295 \ 'py <<EOS', |
1296 \ '.', | 1296 \ '.', |
1297 \ ]) | 1297 \ ]) |
1298 catch | 1298 catch |
1299 call assert_false(1, "Can't define function") | 1299 call assert_report("Can't define function") |
1300 endtry | 1300 endtry |
1301 try | 1301 try |
1302 call DefineFunction('T_Insert', [ | 1302 call DefineFunction('T_Insert', [ |
1303 \ 'insert', | 1303 \ 'insert', |
1304 \ 'abc', | 1304 \ 'abc', |
1305 \ ]) | 1305 \ ]) |
1306 call assert_false(1, "Shouldn't be able to define function") | 1306 call assert_report("Shouldn't be able to define function") |
1307 catch | 1307 catch |
1308 call assert_exception('Vim(function):E126: Missing :endfunction') | 1308 call assert_exception('Vim(function):E126: Missing :endfunction') |
1309 endtry | 1309 endtry |
1310 endfunc | 1310 endfunc |
1311 | 1311 |