diff src/testdir/test_blob.vim @ 30188:ba22d5536d3e v9.0.0430

patch 9.0.0430: cannot use repeat() with a blob Commit: https://github.com/vim/vim/commit/375141e1f80dced9be738568a3418f65813f4a2f Author: Bakudankun <bakudankun@gmail.com> Date: Fri Sep 9 18:46:47 2022 +0100 patch 9.0.0430: cannot use repeat() with a blob Problem: Cannot use repeat() with a blob. Solution: Implement blob repeat. (closes https://github.com/vim/vim/issues/11090)
author Bram Moolenaar <Bram@vim.org>
date Fri, 09 Sep 2022 20:00:05 +0200
parents cadc9851377d
children 029c59bf78f1
line wrap: on
line diff
--- a/src/testdir/test_blob.vim
+++ b/src/testdir/test_blob.vim
@@ -725,6 +725,18 @@ func Test_blob2string()
   call assert_equal(v, string(b))
 endfunc
 
+func Test_blob_repeat()
+  call assert_equal(0z, repeat(0z00, 0))
+  call assert_equal(0z00, repeat(0z00, 1))
+  call assert_equal(0z0000, repeat(0z00, 2))
+  call assert_equal(0z00000000, repeat(0z0000, 2))
+
+  call assert_equal(0z, repeat(0z12, 0))
+  call assert_equal(0z, repeat(0z1234, 0))
+  call assert_equal(0z1234, repeat(0z1234, 1))
+  call assert_equal(0z12341234, repeat(0z1234, 2))
+endfunc
+
 " Test for blob allocation failure
 func Test_blob_alloc_failure()
   " blob variable