diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2020-12-02 17:24:15 +0000 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-15 22:30:30 +0100 |
| commit | 6a02ccc2226ab427d7e6243a5b6d3e424557b0fd (patch) | |
| tree | c13befa39d12386b8c665c4804b2857d5a6dff74 /src/nvim/testdir | |
| parent | 0eadd7e5fd4603fef313fd5fb4cced1b7b5f1679 (diff) | |
| download | rneovim-6a02ccc2226ab427d7e6243a5b6d3e424557b0fd.tar.gz rneovim-6a02ccc2226ab427d7e6243a5b6d3e424557b0fd.tar.bz2 rneovim-6a02ccc2226ab427d7e6243a5b6d3e424557b0fd.zip | |
vim-patch:8.1.0765: string format of a Blob can't be parsed back
Problem: String format of a Blob can't be parsed back.
Solution: Use 0z format.
https://github.com/vim/vim/commit/4131fd5509b283e978e8c6161f09643b64719787
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_blob.vim | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_blob.vim b/src/nvim/testdir/test_blob.vim index b2b5ddcfd6..dec37f0f10 100644 --- a/src/nvim/testdir/test_blob.vim +++ b/src/nvim/testdir/test_blob.vim @@ -26,6 +26,12 @@ func Test_blob_create() call assert_fails('let b = 0z12345', 'E973:') call assert_equal(0z, v:_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() |