aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/tester1.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-01-31 14:25:38 +0000
committerstephan <stephan@noemail.net>2025-01-31 14:25:38 +0000
commit654c94d68382493144a5c34e25937d56ba6fe0da (patch)
tree2dab33850a1200bacc83ab1dfe8926d8fa8ce5a1 /ext/wasm/tester1.c-pp.js
parentd4bfa3465e78cd852506e9c28a733c45d9eec32e (diff)
downloadsqlite-654c94d68382493144a5c34e25937d56ba6fe0da.tar.gz
sqlite-654c94d68382493144a5c34e25937d56ba6fe0da.zip
Cleanups in the opfs-sahpool VFS pause/unpause feature and its tests.
FossilOrigin-Name: 184ba37702f63196deca91d273e798ca895fbb301938e6264bc82815a4e33149
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r--ext/wasm/tester1.c-pp.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js
index f5fff0cfc..969fcf067 100644
--- a/ext/wasm/tester1.c-pp.js
+++ b/ext/wasm/tester1.c-pp.js
@@ -3155,12 +3155,23 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
T.assert(1 === u1.getFileCount());
db = new u2.OpfsSAHPoolDb(dbName);
T.assert(1 === u1.getFileCount())
- .mustThrow(()=>u2.pauseVfs(), "Cannot pause VFS with opened db.");
+ .mustThrowMatching(
+ ()=>u1.pauseVfs(),
+ (err)=>{
+ return capi.SQLITE_MISUSE===err.resultCode
+ && /^SQLITE_MISUSE: Cannot pause VFS /.test(err.message);
+ },
+ "Cannot pause VFS with opened db."
+ );
db.close();
T.assert( u2===u2.pauseVfs() )
.assert( u2.isPaused() )
.assert( 0===capi.sqlite3_vfs_find(u2.vfsName) )
+ .mustThrowMatching(()=>new u2.OpfsSAHPoolDb(dbName),
+ /.+no such vfs: .+/,
+ "VFS is not available")
.assert( u2===await u2.unpauseVfs() )
+ .assert( u2===await u1.unpauseVfs(), "unpause is a no-op if the VFS is not paused" )
.assert( 0!==capi.sqlite3_vfs_find(u2.vfsName) );
const fileNames = u1.getFileNames();
T.assert(1 === fileNames.length)