summaryrefslogtreecommitdiff
path: root/src/testdir/test_blob.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-17 16:32:53 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-17 16:32:53 +0100
commit4131fd5509b283e978e8c6161f09643b64719787 (patch)
tree7b01e6afbeaf439a5a7f18c71906d8d58f107838 /src/testdir/test_blob.vim
parent6e0b6a0bec093b2fbc2e630312ec412f3f2c2254 (diff)
downloadvim-git-4131fd5509b283e978e8c6161f09643b64719787.tar.gz
patch 8.1.0765: string format of a Blob can't be parsed backv8.1.0765
Problem: String format of a Blob can't be parsed back. Solution: Use 0z format.
Diffstat (limited to 'src/testdir/test_blob.vim')
-rw-r--r--src/testdir/test_blob.vim15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/testdir/test_blob.vim b/src/testdir/test_blob.vim
index d5f682f54..1feab3415 100644
--- a/src/testdir/test_blob.vim
+++ b/src/testdir/test_blob.vim
@@ -26,6 +26,12 @@ func Test_blob_create()
call assert_fails('let b = 0z12345', 'E973:')
call assert_equal(0z, test_null_blob())
+
+ let b = 0z001122.33445566.778899.aabbcc.dd
+ call assert_equal(0z00112233445566778899aabbccdd, b)
+ call assert_fails('let b = 0z1.1')
+ call assert_fails('let b = 0z.')
+ call assert_fails('let b = 0z001122.')
endfunc
" assignment to a blob
@@ -91,10 +97,13 @@ func Test_blob_get()
endfunc
func Test_blob_to_string()
- let b = 0zDEADBEEF
- call assert_equal('[0xDE,0xAD,0xBE,0xEF]', string(b))
+ let b = 0z00112233445566778899aabbccdd
+ call assert_equal('0z00112233.44556677.8899AABB.CCDD', string(b))
+ call assert_equal(b, eval(string(b)))
+ call remove(b, 4, -1)
+ call assert_equal('0z00112233', string(b))
call remove(b, 0, 3)
- call assert_equal('[]', string(b))
+ call assert_equal('0z', string(b))
endfunc
func Test_blob_compare()