@livestore/wa-sqlite 0.4.0-dev.21 → 0.4.0-dev.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -36
- package/dist/README.md +13 -13
- package/dist/fts5/wa-sqlite.mjs +1 -1
- package/dist/fts5/wa-sqlite.node.mjs +1 -1
- package/dist/fts5/wa-sqlite.node.wasm +0 -0
- package/dist/fts5/wa-sqlite.wasm +0 -0
- package/dist/wa-sqlite-async.mjs +1 -1
- package/dist/wa-sqlite-async.wasm +0 -0
- package/dist/wa-sqlite-jspi.mjs +1 -1
- package/dist/wa-sqlite-jspi.wasm +0 -0
- package/dist/wa-sqlite.mjs +1 -1
- package/dist/wa-sqlite.node.mjs +1 -1
- package/dist/wa-sqlite.node.wasm +0 -0
- package/dist/wa-sqlite.wasm +0 -0
- package/package.json +40 -29
- package/src/FacadeVFS.js +252 -261
- package/src/VFS.js +84 -85
- package/src/WebLocksMixin.js +357 -351
- package/src/examples/AccessHandlePoolVFS.js +185 -194
- package/src/examples/IDBBatchAtomicVFS.js +429 -409
- package/src/examples/IDBMirrorVFS.js +402 -409
- package/src/examples/MemoryAsyncVFS.js +32 -37
- package/src/examples/MemoryVFS.js +71 -75
- package/src/examples/OPFSAdaptiveVFS.js +206 -206
- package/src/examples/OPFSAnyContextVFS.js +141 -140
- package/src/examples/OPFSCoopSyncVFS.js +297 -299
- package/src/examples/OPFSPermutedVFS.js +529 -540
- package/src/examples/README.md +27 -15
- package/src/examples/tag.js +27 -27
- package/src/sqlite-api.js +910 -941
- package/src/sqlite-constants.js +246 -232
- package/src/types/globals.d.ts +52 -52
- package/src/types/index.d.ts +586 -576
- package/test/AccessHandlePoolVFS.test.js +21 -21
- package/test/IDBBatchAtomicVFS.test.js +69 -69
- package/test/IDBMirrorVFS.test.js +21 -21
- package/test/MemoryAsyncVFS.test.js +21 -21
- package/test/MemoryVFS.test.js +21 -21
- package/test/OPFSAdaptiveVFS.test.js +21 -21
- package/test/OPFSAnyContextVFS.test.js +21 -21
- package/test/OPFSCoopSyncVFS.test.js +21 -21
- package/test/OPFSPermutedVFS.test.js +21 -21
- package/test/TestContext.js +44 -41
- package/test/WebLocksMixin.test.js +369 -360
- package/test/api.test.js +23 -23
- package/test/api_exec.js +72 -61
- package/test/api_misc.js +53 -54
- package/test/api_statements.js +271 -279
- package/test/callbacks.test.js +492 -478
- package/test/data/idbv5.json +1135 -1
- package/test/sql.test.js +30 -30
- package/test/sql_0001.js +49 -33
- package/test/sql_0002.js +55 -34
- package/test/sql_0003.js +85 -49
- package/test/sql_0004.js +76 -47
- package/test/sql_0005.js +60 -44
- package/test/test-worker.js +171 -163
- package/test/vfs_xAccess.js +1 -2
- package/test/vfs_xClose.js +50 -49
- package/test/vfs_xOpen.js +73 -72
- package/test/vfs_xRead.js +31 -31
- package/test/vfs_xWrite.js +30 -29
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'AccessHandlePoolVFS'
|
|
9
|
-
const BUILDS = ['default', 'asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'AccessHandlePoolVFS'
|
|
9
|
+
const BUILDS = ['default', 'asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
1
|
+
import SQLiteESMFactory from '../dist/wa-sqlite-async.mjs'
|
|
2
|
+
import { IDBBatchAtomicVFS } from '../src/examples/IDBBatchAtomicVFS.js'
|
|
3
|
+
import * as SQLite from '../src/sqlite-api.js'
|
|
4
|
+
import { TestContext } from './TestContext.js'
|
|
5
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
6
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
7
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
8
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
9
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
10
|
+
|
|
11
|
+
const CONFIG = 'IDBBatchAtomicVFS'
|
|
12
|
+
const BUILDS = ['asyncify', 'jspi']
|
|
13
|
+
|
|
14
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
15
|
+
|
|
16
|
+
describe(CONFIG, function () {
|
|
17
|
+
for (const build of BUILDS) {
|
|
18
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
describe(build, function () {
|
|
21
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
vfs_xAccess(context);
|
|
25
|
-
vfs_xOpen(context);
|
|
26
|
-
vfs_xClose(context);
|
|
27
|
-
vfs_xRead(context);
|
|
28
|
-
vfs_xWrite(context);
|
|
29
|
-
});
|
|
23
|
+
vfs_xAccess(context)
|
|
24
|
+
vfs_xOpen(context)
|
|
25
|
+
vfs_xClose(context)
|
|
26
|
+
vfs_xRead(context)
|
|
27
|
+
vfs_xWrite(context)
|
|
28
|
+
})
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
it('should upgrade v5', async function() {
|
|
33
|
-
await idbX(indexedDB.deleteDatabase('test'))
|
|
31
|
+
it('should upgrade v5', async function () {
|
|
32
|
+
await idbX(indexedDB.deleteDatabase('test'))
|
|
34
33
|
|
|
35
34
|
{
|
|
36
35
|
// Load IndexedDB with v5 data.
|
|
37
36
|
const db = await new Promise((resolve, reject) => {
|
|
38
|
-
const request = indexedDB.open('test', 5)
|
|
37
|
+
const request = indexedDB.open('test', 5)
|
|
39
38
|
request.onupgradeneeded = () => {
|
|
40
|
-
const db = request.result
|
|
39
|
+
const db = request.result
|
|
41
40
|
db.createObjectStore('blocks', {
|
|
42
|
-
keyPath: ['path', 'offset', 'version']
|
|
43
|
-
}).createIndex('version', ['path', 'version'])
|
|
44
|
-
}
|
|
45
|
-
request.onsuccess = () => resolve(request.result)
|
|
46
|
-
request.onerror = () => reject(request.error)
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
const data = await fetch(new URL('./data/idbv5.json', import.meta.url))
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
keyPath: ['path', 'offset', 'version'],
|
|
42
|
+
}).createIndex('version', ['path', 'version'])
|
|
43
|
+
}
|
|
44
|
+
request.onsuccess = () => resolve(request.result)
|
|
45
|
+
request.onerror = () => reject(request.error)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const data = await fetch(new URL('./data/idbv5.json', import.meta.url)).then((response) => response.json())
|
|
49
|
+
const blocks = db.transaction('blocks', 'readwrite').objectStore('blocks')
|
|
50
|
+
await Promise.all(
|
|
51
|
+
data.blocks.map((block) => {
|
|
52
|
+
block.data = new Uint8Array(block.data)
|
|
53
|
+
return idbX(blocks.put(block))
|
|
54
|
+
}),
|
|
55
|
+
)
|
|
56
|
+
db.close()
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// Initialize SQLite.
|
|
60
|
-
const module = await SQLiteESMFactory()
|
|
61
|
-
const sqlite3 = SQLite.Factory(module)
|
|
60
|
+
const module = await SQLiteESMFactory()
|
|
61
|
+
const sqlite3 = SQLite.Factory(module)
|
|
62
62
|
|
|
63
|
-
const vfs = await IDBBatchAtomicVFS.create('test', module)
|
|
63
|
+
const vfs = await IDBBatchAtomicVFS.create('test', module)
|
|
64
64
|
// @ts-ignore
|
|
65
|
-
sqlite3.vfs_register(vfs, true)
|
|
65
|
+
sqlite3.vfs_register(vfs, true)
|
|
66
66
|
|
|
67
|
-
const db = await sqlite3.open_v2('demo')
|
|
67
|
+
const db = await sqlite3.open_v2('demo')
|
|
68
68
|
|
|
69
|
-
let integrity = ''
|
|
69
|
+
let integrity = ''
|
|
70
70
|
await sqlite3.exec(db, 'PRAGMA integrity_check', (row, columns) => {
|
|
71
|
-
integrity = /** @type {string} */(row[0])
|
|
72
|
-
})
|
|
73
|
-
expect(integrity).toBe('ok')
|
|
71
|
+
integrity = /** @type {string} */ (row[0])
|
|
72
|
+
})
|
|
73
|
+
expect(integrity).toBe('ok')
|
|
74
74
|
|
|
75
|
-
const rows = []
|
|
75
|
+
const rows = []
|
|
76
76
|
await sqlite3.exec(db, 'SELECT x FROM foo ORDER BY rowid LIMIT 3', (row, columns) => {
|
|
77
|
-
rows.push(row[0])
|
|
78
|
-
})
|
|
79
|
-
expect(rows).toEqual([1, 2, 3])
|
|
77
|
+
rows.push(row[0])
|
|
78
|
+
})
|
|
79
|
+
expect(rows).toEqual([1, 2, 3])
|
|
80
80
|
|
|
81
|
-
await sqlite3.close(db)
|
|
82
|
-
await vfs.close()
|
|
81
|
+
await sqlite3.close(db)
|
|
82
|
+
await vfs.close()
|
|
83
83
|
|
|
84
|
-
await idbX(indexedDB.deleteDatabase('test'))
|
|
85
|
-
})
|
|
86
|
-
})
|
|
84
|
+
await idbX(indexedDB.deleteDatabase('test'))
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
* @param {IDBRequest} request
|
|
89
|
+
* @param {IDBRequest} request
|
|
90
90
|
* @returns {Promise}
|
|
91
91
|
*/
|
|
92
92
|
function idbX(request) {
|
|
93
93
|
return new Promise((resolve, reject) => {
|
|
94
|
-
request.onsuccess = () => resolve(request.result)
|
|
95
|
-
request.onerror = () => reject(request.error)
|
|
96
|
-
})
|
|
97
|
-
}
|
|
94
|
+
request.onsuccess = () => resolve(request.result)
|
|
95
|
+
request.onerror = () => reject(request.error)
|
|
96
|
+
})
|
|
97
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'IDBMirrorVFS'
|
|
9
|
-
const BUILDS = ['asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'IDBMirrorVFS'
|
|
9
|
+
const BUILDS = ['asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'MemoryAsyncVFS'
|
|
9
|
-
const BUILDS = ['asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'MemoryAsyncVFS'
|
|
9
|
+
const BUILDS = ['asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
package/test/MemoryVFS.test.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'MemoryVFS'
|
|
9
|
-
const BUILDS = ['default', 'asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'MemoryVFS'
|
|
9
|
+
const BUILDS = ['default', 'asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'OPFSAdaptiveVFS'
|
|
9
|
-
const BUILDS = ['asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'OPFSAdaptiveVFS'
|
|
9
|
+
const BUILDS = ['asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'OPFSAnyContextVFS'
|
|
9
|
-
const BUILDS = ['asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'OPFSAnyContextVFS'
|
|
9
|
+
const BUILDS = ['asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'OPFSCoopSyncVFS'
|
|
9
|
-
const BUILDS = ['default', 'asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'OPFSCoopSyncVFS'
|
|
9
|
+
const BUILDS = ['default', 'asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TestContext } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { vfs_xRead } from
|
|
6
|
-
import { vfs_xWrite } from
|
|
1
|
+
import { TestContext } from './TestContext.js'
|
|
2
|
+
import { vfs_xAccess } from './vfs_xAccess.js'
|
|
3
|
+
import { vfs_xClose } from './vfs_xClose.js'
|
|
4
|
+
import { vfs_xOpen } from './vfs_xOpen.js'
|
|
5
|
+
import { vfs_xRead } from './vfs_xRead.js'
|
|
6
|
+
import { vfs_xWrite } from './vfs_xWrite.js'
|
|
7
7
|
|
|
8
|
-
const CONFIG = 'OPFSPermutedVFS'
|
|
9
|
-
const BUILDS = ['asyncify', 'jspi']
|
|
8
|
+
const CONFIG = 'OPFSPermutedVFS'
|
|
9
|
+
const BUILDS = ['asyncify', 'jspi']
|
|
10
10
|
|
|
11
|
-
const supportsJSPI = await TestContext.supportsJSPI()
|
|
11
|
+
const supportsJSPI = await TestContext.supportsJSPI()
|
|
12
12
|
|
|
13
|
-
describe(CONFIG, function() {
|
|
13
|
+
describe(CONFIG, function () {
|
|
14
14
|
for (const build of BUILDS) {
|
|
15
|
-
if (build === 'jspi' && !supportsJSPI) return
|
|
15
|
+
if (build === 'jspi' && !supportsJSPI) return
|
|
16
16
|
|
|
17
|
-
describe(build, function() {
|
|
18
|
-
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
-
|
|
20
|
-
vfs_xAccess(context)
|
|
21
|
-
vfs_xOpen(context)
|
|
22
|
-
vfs_xClose(context)
|
|
23
|
-
vfs_xRead(context)
|
|
24
|
-
vfs_xWrite(context)
|
|
25
|
-
})
|
|
17
|
+
describe(build, function () {
|
|
18
|
+
const context = new TestContext({ build, config: CONFIG })
|
|
19
|
+
|
|
20
|
+
vfs_xAccess(context)
|
|
21
|
+
vfs_xOpen(context)
|
|
22
|
+
vfs_xClose(context)
|
|
23
|
+
vfs_xRead(context)
|
|
24
|
+
vfs_xWrite(context)
|
|
25
|
+
})
|
|
26
26
|
}
|
|
27
|
-
})
|
|
27
|
+
})
|