未验证 提交 121969e7 编写于 作者: O openharmony_ci 提交者: Gitee

!9358 Add XTS for fs.Watcher interface

Merge pull request !9358 from 冯俊青/master
......@@ -83,6 +83,13 @@ export function randomString(num) {
return pwd;
}
export async function sleep(times) {
if (!times) {
times = 10;
}
await new Promise((res) => setTimeout(res, times));
}
function isIntNum(val) {
return typeof val === 'number' && val % 1 === 0;
}
......
......@@ -47,6 +47,7 @@ import fileIOStreamWrite from './class_stream/write.test.js'
import fileIOSymlink from './members/symlink.test.js'
import fileIOTruncate from './members/truncate.test.js'
import fileIOUnlink from './members/unlink.test.js'
import fileIOWatcher from './members/watcher.test.js'
import fileIOWrite from './members/write.test.js'
import fileIORW from './members/filerw.test.js'
export default function testsuite() {
......@@ -84,6 +85,7 @@ export default function testsuite() {
fileIOSymlink()
fileIOTruncate()
fileIOUnlink()
fileIOWatcher()
fileIOWrite()
fileIORW()
}
......@@ -224,9 +224,10 @@ describe('fileIO_fs_mkdir', function () {
expect(prepareFile(fpath, FILE_CONTENT)).assertTrue();
try {
await fileIO.mkdirSync(fpath);
await fileIO.mkdir(fpath);
expect(false).assertTrue();
} catch (e) {
fileIO.unlinkSync(fpath);
console.log('fileIO_test_mkdir_async_004 has failed for ' + e.message + ', code: ' + e.code);
expect(e.code == 13900015 && e.message == 'File exists').assertTrue();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册