From 680f847e0a5d3f88b5128bf56d0dd511a50ff091 Mon Sep 17 00:00:00 2001 From: zhangxingxia Date: Wed, 8 Jun 2022 16:33:13 +0800 Subject: [PATCH] update fileio xts Signed-off-by: zhangxingxia --- .../js/default/test/module_fileio/class_stream/write.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/storagefileiojstest/src/main/js/default/test/module_fileio/class_stream/write.test.js b/storage/storagefileiojstest/src/main/js/default/test/module_fileio/class_stream/write.test.js index e739693a6..f375f3b4b 100644 --- a/storage/storagefileiojstest/src/main/js/default/test/module_fileio/class_stream/write.test.js +++ b/storage/storagefileiojstest/src/main/js/default/test/module_fileio/class_stream/write.test.js @@ -130,7 +130,9 @@ describe('fileio_stream_write', function () { let bytesWritten = await ss.write(content, {offset:1, position:5, encoding: 'utf-8' }); expect(bytesWritten == content.length-1).assertTrue(); let readOut = await ss.read(new ArrayBuffer(4096), {offset:0,position: 0}); - let result = String.fromCharCode.apply(null, new Uint8Array(readOut.buffer.slice(readOut.offset,readOut.offset+readOut.bytesRead))); + let start = readOut.offset; + let end = readOut.offset+readOut.bytesRead; + let result = String.fromCharCode.apply(null, new Uint8Array(readOut.buffer.slice(start,end))); expect(result == "helloestrld").assertTrue(); fileio.unlinkSync(fpath); ss.closeSync(); -- GitLab