Skip to content

Commit

Permalink
chroe: test on safari
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Aug 19, 2024
1 parent 72d357e commit 2f2a693
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion demo/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { tmpfile, write } from '../src';
import { tmpfile, file, write } from '../src';

console.log(111, localStorage.getItem('OPFS_TOOLS_EXPIRES_TMP_FILES'));
const f = tmpfile();
Expand All @@ -7,4 +7,13 @@ await write(f, '111111111');

await write('/.opfs-tools-temp-dir/xxx', '2222');

const filePath = '/unit-test/file';
const f1 = file(filePath, 'rw-unsafe');
const f2 = file(filePath, 'rw-unsafe');

await write(f1, '111');
await write(f1, '222');

console.log('多文件句柄读写', (await f2.text()) === '222');

export {};

0 comments on commit 2f2a693

Please sign in to comment.