comparison src/testdir/test_blob.vim @ 25302:4d3c68196d05 v8.2.3188

patch 8.2.3188: Vim9: argument types are not checked at compile time Commit: https://github.com/vim/vim/commit/83494b4ac61898f687d6ef9dce4bad5802fb8e51 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Tue Jul 20 17:51:51 2021 +0200 patch 8.2.3188: Vim9: argument types are not checked at compile time Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks, also at runtime. (Yegappan Lakshmanan, closes #8587)
author Bram Moolenaar <Bram@vim.org>
date Tue, 20 Jul 2021 18:00:06 +0200
parents 5e0db87e5184
children e2be9f3c5907
comparison
equal deleted inserted replaced
25301:fe178301fc04 25302:4d3c68196d05
423 END 423 END
424 call CheckLegacyAndVim9Failure(lines, 'E979:') 424 call CheckLegacyAndVim9Failure(lines, 'E979:')
425 425
426 let lines =<< trim END 426 let lines =<< trim END
427 VAR b = 0zDEADBEEF 427 VAR b = 0zDEADBEEF
428 call remove(1, 0)
429 END
430 call CheckLegacyAndVim9Failure(lines, 'E896:')
431
432 let lines =<< trim END
433 VAR b = 0zDEADBEEF
434 call remove(b, b)
435 END
436 call CheckLegacyAndVim9Failure(lines, 'E974:')
437
438 let lines =<< trim END
439 VAR b = 0zDEADBEEF
440 call remove(b, 1, [])
441 END
442 call CheckLegacyAndVim9Failure(lines, 'E745:')
443
444 let lines =<< trim END
445 VAR b = 0zDEADBEEF
446 call remove(test_null_blob(), 1, 2) 428 call remove(test_null_blob(), 1, 2)
447 END 429 END
448 call CheckLegacyAndVim9Failure(lines, 'E979:') 430 call CheckLegacyAndVim9Failure(lines, 'E979:')
449 endfunc 431 endfunc
450 432
502 call assert_equal(3, index(0z11110111, 0x11, -2)) 484 call assert_equal(3, index(0z11110111, 0x11, -2))
503 call assert_equal(0, index(0z11110111, 0x11, -10)) 485 call assert_equal(0, index(0z11110111, 0x11, -10))
504 call assert_equal(-1, index(test_null_blob(), 1)) 486 call assert_equal(-1, index(test_null_blob(), 1))
505 END 487 END
506 call CheckLegacyAndVim9Success(lines) 488 call CheckLegacyAndVim9Success(lines)
507
508 let lines =<< trim END
509 echo index(0z11110111, 0x11, [])
510 END
511 call CheckLegacyAndVim9Failure(lines, 'E745:')
512
513 let lines =<< trim END
514 call index("asdf", 0)
515 END
516 call CheckLegacyAndVim9Failure(lines, 'E897:')
517 endfunc 489 endfunc
518 490
519 func Test_blob_insert() 491 func Test_blob_insert()
520 let lines =<< trim END 492 let lines =<< trim END
521 VAR b = 0zDEADBEEF 493 VAR b = 0zDEADBEEF