Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 24484:bc1a533148d7 v8.2.2782
patch 8.2.2782: Vim9: blob operations not fully tested
Commit: https://github.com/vim/vim/commit/39211cba723a2cb58a97c7e08826713164b86efc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 18 15:48:04 2021 +0200
patch 8.2.2782: Vim9: blob operations not fully tested
Problem: Vim9: blob operations not fully tested.
Solution: Make more blob tests run in Vim9 script. Fix filter(). Make
insert() give an error for a null blob, like add().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 18 Apr 2021 16:00:06 +0200 |
parents | 3d5a66e478f8 |
children | abc4793f48a3 |
comparison
equal
deleted
inserted
replaced
24483:798fcf242d48 | 24484:bc1a533148d7 |
---|---|
716 var res = 0 | 716 var res = 0 |
717 for n in l | 717 for n in l |
718 res += n | 718 res += n |
719 endfor | 719 endfor |
720 res->assert_equal(6) | 720 res->assert_equal(6) |
721 | |
722 var lines =<< trim END | |
723 insert(test_null_list(), 123) | |
724 END | |
725 CheckDefExecAndScriptFailure(lines, 'E1130:', 1) | |
726 | |
727 lines =<< trim END | |
728 insert(test_null_blob(), 123) | |
729 END | |
730 CheckDefExecAndScriptFailure(lines, 'E1131:', 1) | |
721 | 731 |
722 assert_equal([1, 2, 3], insert([2, 3], 1)) | 732 assert_equal([1, 2, 3], insert([2, 3], 1)) |
723 assert_equal([1, 2, 3], insert([2, 3], s:number_one)) | 733 assert_equal([1, 2, 3], insert([2, 3], s:number_one)) |
724 assert_equal([1, 2, 3], insert([1, 2], 3, 2)) | 734 assert_equal([1, 2, 3], insert([1, 2], 3, 2)) |
725 assert_equal([1, 2, 3], insert([1, 2], 3, s:number_two)) | 735 assert_equal([1, 2, 3], insert([1, 2], 3, s:number_two)) |