comparison src/testdir/test_blob.vim @ 25822:42723b535ab3 v8.2.3446

patch 8.2.3446: not enough tests for empty string arguments Commit: https://github.com/vim/vim/commit/820d5525cae707f39571c6abc2aa6a9e66ed171e Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Fri Sep 17 21:07:35 2021 +0200 patch 8.2.3446: not enough tests for empty string arguments Problem: Not enough tests for empty string arguments. Solution: Add tests, fix type check. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8881)
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 Sep 2021 21:15:03 +0200
parents 8d55e978f95b
children 43d196ca5e7a
comparison
equal deleted inserted replaced
25821:ef98a99ef1ae 25822:42723b535ab3
661 call assert_fails('let b = list2blob(0z10)', 'E1211: List required for argument 1') 661 call assert_fails('let b = list2blob(0z10)', 'E1211: List required for argument 1')
662 let tests = [[[1, 2], 0z0102], 662 let tests = [[[1, 2], 0z0102],
663 \ [[0], 0z00], 663 \ [[0], 0z00],
664 \ [[], 0z], 664 \ [[], 0z],
665 \ [[0, 0, 0, 0], 0z00000000], 665 \ [[0, 0, 0, 0], 0z00000000],
666 \ [[255, 255], 0zFFFF],
666 \ [[170, 187, 204, 221], 0zAABB.CCDD], 667 \ [[170, 187, 204, 221], 0zAABB.CCDD],
667 \ ] 668 \ ]
668 for t in tests 669 for t in tests
669 call assert_equal(t[0]->list2blob(), t[1]) 670 call assert_equal(t[1], t[0]->list2blob())
670 endfor 671 endfor
671 call assert_fails('let b = list2blob([1, []])', 'E745:') 672 call assert_fails('let b = list2blob([1, []])', 'E745:')
672 call assert_fails('let b = list2blob([-1])', 'E1239:') 673 call assert_fails('let b = list2blob([-1])', 'E1239:')
673 call assert_fails('let b = list2blob([256])', 'E1239:') 674 call assert_fails('let b = list2blob([256])', 'E1239:')
674 let b = range(16)->repeat(64)->list2blob() 675 let b = range(16)->repeat(64)->list2blob()