comparison src/testdir/test_blob.vim @ 30938:84f6f91ca02a v9.0.0803

patch 9.0.0803: readblob() cannot read from character device Commit: https://github.com/vim/vim/commit/43625762a9751cc6e6e4d8f54fbc8b82d98fb20d Author: K.Takata <kentkt@csc.jp> Date: Thu Oct 20 13:28:51 2022 +0100 patch 9.0.0803: readblob() cannot read from character device Problem: readblob() cannot read from character device. Solution: Use S_ISCHR() to not check the size. (Ken Takata, closes https://github.com/vim/vim/issues/11407)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Oct 2022 14:30:13 +0200
parents ed6acfafa17e
children 61558a67630a
comparison
equal deleted inserted replaced
30937:d192688c8bab 30938:84f6f91ca02a
505 call assert_equal(0z, br2e) 505 call assert_equal(0z, br2e)
506 506
507 call delete('Xblob') 507 call delete('Xblob')
508 END 508 END
509 call v9.CheckLegacyAndVim9Success(lines) 509 call v9.CheckLegacyAndVim9Success(lines)
510
511 if filereadable('/dev/random')
512 let b = readblob('/dev/random', 0, 10)
513 call assert_equal(10, len(b))
514 endif
510 515
511 call assert_fails("call readblob('notexist')", 'E484:') 516 call assert_fails("call readblob('notexist')", 'E484:')
512 " TODO: How do we test for the E485 error? 517 " TODO: How do we test for the E485 error?
513 518
514 " This was crashing when calling readfile() with a directory. 519 " This was crashing when calling readfile() with a directory.