From e29c98bb55fd999b6f5d10891fa24afdc4ea185a Mon Sep 17 00:00:00 2001 From: zhangxingxia Date: Wed, 8 Jun 2022 18:02:39 +0800 Subject: [PATCH] update fileio xts Signed-off-by: zhangxingxia --- .../src/main/js/default/test/FileIOStream.test.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/storage/storagefileiojstest/src/main/js/default/test/FileIOStream.test.js b/storage/storagefileiojstest/src/main/js/default/test/FileIOStream.test.js index fa143cd4c..4a9f1e495 100644 --- a/storage/storagefileiojstest/src/main/js/default/test/FileIOStream.test.js +++ b/storage/storagefileiojstest/src/main/js/default/test/FileIOStream.test.js @@ -1385,19 +1385,18 @@ describe('fileIOTestStream', function () { let fpath = await nextFileName('fileio_test_stream_read_sync_005'); let text = '0123456789abcdefg'; expect(prepareFile(fpath, text)).assertTrue(); + let ss = fileio.createStreamSync(fpath, 'r+'); + expect(ss !== null).assertTrue(); try { - var ss = fileio.createStreamSync(fpath, 'r+'); - expect(ss !== null).assertTrue(); - let len = ss.readSync(new ArrayBuffer(4096), { + ss.readSync(new ArrayBuffer(4096), { position: -1 }); - expect(len == text.length).assertTrue(); - ss.closeSync(); - fileio.unlinkSync(fpath); } catch (e) { - console.log('---fileio_test_stream_read_sync_005 has failed for ' + e); - expect(null).assertFail(); + console.info('fileio_test_stream_read_sync_005 has failed for ' + e); + expect(e.message == "option.position shall be positive number").assertTrue(); + ss.closeSync(); + fileio.unlinkSync(fpath); } }); -- GitLab