1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Minor doc cleanups in SQLTester.mjs and confirm that the tests pass with both OPFS VFSes.

FossilOrigin-Name: ac747d57c2a26b47644bca2a9b191b09f5180f6872dce9c3261c370a18c848a2
This commit is contained in:
stephan
2024-10-18 23:54:23 +00:00
parent 23caead6cb
commit a525d635a9
5 changed files with 21 additions and 21 deletions

View File

@@ -13,8 +13,8 @@
** implementation of the SQLTester framework. ** implementation of the SQLTester framework.
** **
** This version is not well-documented because it's a direct port of ** This version is not well-documented because it's a direct port of
** the Java immplementation, which is documented: in the main SQLite3 ** the Java implementation, which is documented: in the main SQLite3
** source tree, see ext/jni/src/org/sqlite/jni/tester/SQLite3Tester.java. ** source tree, see ext/jni/src/org/sqlite/jni/capi/SQLTester.java.
*/ */
import sqlite3ApiInit from '/jswasm/sqlite3.mjs'; import sqlite3ApiInit from '/jswasm/sqlite3.mjs';
@@ -28,7 +28,7 @@ const log = (...args)=>{
/** /**
Try to install vfsName as the new default VFS. Once this succeeds Try to install vfsName as the new default VFS. Once this succeeds
(returns true) then it becomes a no-op on future calls. Throws if (returns true) then it becomes a no-op on future calls. Throws if
vfs registration as the default VFS fails but has no side effects VFS registration as the default VFS fails but has no side effects
if vfsName is not currently registered. if vfsName is not currently registered.
*/ */
const tryInstallVfs = function f(vfsName){ const tryInstallVfs = function f(vfsName){
@@ -48,11 +48,10 @@ tryInstallVfs.vfsName = undefined;
if( 0 && globalThis.WorkerGlobalScope ){ if( 0 && globalThis.WorkerGlobalScope ){
// Try OPFS storage, if available... // Try OPFS storage, if available...
if( 0 && sqlite3.oo1.OpfsDb ){ if( 1 && sqlite3.oo1.OpfsDb ){
/* Really slow with these tests */ /* Really slow with these tests */
tryInstallVfs("opfs"); tryInstallVfs("opfs");
} }else if( sqlite3.installOpfsSAHPoolVfs ){
if( sqlite3.installOpfsSAHPoolVfs ){
await sqlite3.installOpfsSAHPoolVfs({ await sqlite3.installOpfsSAHPoolVfs({
clearOnInit: true, clearOnInit: true,
initialCapacity: 15, initialCapacity: 15,
@@ -207,6 +206,9 @@ const Util = newObj({
['string','string']) ['string','string'])
})/*Util*/; })/*Util*/;
/**
Output logger utility.
*/
class Outer { class Outer {
#lnBuf = []; #lnBuf = [];
#verbosity = 0; #verbosity = 0;

View File

@@ -9,7 +9,8 @@
** May you share freely, never taking more than you give. ** May you share freely, never taking more than you give.
** **
************************************************************************* *************************************************************************
** This file contains a test application for SQLTester.js. ** This file contains a test application for SQLTester.mjs. It loads
** test scripts and runs them through the SQLTester class.
*/ */
import {default as ns} from './SQLTester.mjs'; import {default as ns} from './SQLTester.mjs';
import {default as allTests} from './test-list.mjs'; import {default as allTests} from './test-list.mjs';
@@ -33,7 +34,7 @@ const affirm = function(expr, msg){
} }
} }
let ts = new ns.TestScript('/foo.test',` let ts = new ns.TestScript('SQLTester-sanity-check.test',`
/* /*
** This is a comment. There are many like it but this one is mine. ** This is a comment. There are many like it but this one is mine.
** **
@@ -93,6 +94,7 @@ SELECT json_array(1,2,3)
select 1 as 'a', 2 as 'b'; select 1 as 'a', 2 as 'b';
--result 1 2 --result 1 2
--close --close
--testcase the-end
--print Until next time --print Until next time
`); `);
@@ -112,8 +114,6 @@ const runTests = function(){
ts.run(sqt); ts.run(sqt);
affirm( 'zilch' === sqt.nullValue() ); affirm( 'zilch' === sqt.nullValue() );
sqt.addTestScript(ts); sqt.addTestScript(ts);
}else if(0){
sqt.addTestScript(ts);
}else{ }else{
for(const t of allTests){ for(const t of allTests){
sqt.addTestScript( new ns.TestScript(t) ); sqt.addTestScript( new ns.TestScript(t) );

View File

@@ -119,8 +119,6 @@
break; break;
} }
}; };
//runTests()
/* Inexplicably, */
})(); })();
</script> </script>
</body> </body>

View File

@@ -1,5 +1,5 @@
C Fix\sthree\sbugs\sin\sSQLTester.mjs\swhich\scaused\s--tableresult\stests,\sescaping\sof\sSQL\svalues\sto\sincorrectly\sfail,\sand\sthe\s--column-names\ssetting\sto\snot\sbe\sreset\sbetween\stests. C Minor\sdoc\scleanups\sin\sSQLTester.mjs\sand\sconfirm\sthat\sthe\stests\spass\swith\sboth\sOPFS\sVFSes.
D 2024-10-18T23:36:08.764 D 2024-10-18T23:54:23.694
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -612,9 +612,9 @@ F ext/wasm/GNUmakefile 128f8e9830dd8c50c14558649a6f13a2742e9d48223cc67485779baee
F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576
F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
F ext/wasm/SQLTester/SQLTester.mjs 41d405eaecf8a0d837e526656167563fa0f33ea985bb49593e1a1d3bd2a8ba9d F ext/wasm/SQLTester/SQLTester.mjs 66e1adc3d79467b68e3e40614fd42c1a577c7e219ec0985db966eded52a941e5
F ext/wasm/SQLTester/SQLTester.run.mjs beace5a76a7a56f8b336e109f7da15d8d06d633eebebfb85bb26d3b4a1d3dad5 F ext/wasm/SQLTester/SQLTester.run.mjs 57f2adb33f43f2784abbf8026c1bfd049d8013af1998e7dcb8b50c89ffc332e0
F ext/wasm/SQLTester/index.html 3f8a016df0776be76605abf20e815ecaafbe055abac0e1fe5ea080e7846b760d F ext/wasm/SQLTester/index.html 64f3435084c7d6139b08d1f2a713828a73f68de2ae6a3112cbb5980d991ba06f
F ext/wasm/SQLTester/touint8array.c 2d5ece04ec1393a6a60c4bf96385bda5e1a10ad49f3038b96460fc5e5aa7e536 F ext/wasm/SQLTester/touint8array.c 2d5ece04ec1393a6a60c4bf96385bda5e1a10ad49f3038b96460fc5e5aa7e536
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core 2bcbbfe3b95c043ed6037e2708a2ee078d212dd1612c364f93588d8dc97300fe F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core 2bcbbfe3b95c043ed6037e2708a2ee078d212dd1612c364f93588d8dc97300fe
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951e10884214f5453d35502100179c388c13 F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951e10884214f5453d35502100179c388c13
@@ -2219,8 +2219,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 31179fa78e47cafae49df35f28e5c4b01654665d54ee60d059545ce2d97a39a2 P 779368dd9b8bb20890b06229c4c3c3b5d153ee88d1af472799515cdc599c870a
R 1b048eaff8c11ad5f6abc5fcdc2c6077 R 38c8cbe7585681d77c9e8f8ff1f867fd
U stephan U stephan
Z ed8c20191a02ef81280c701c6505fc65 Z b702bafea7281c06a3d6db71e8342e04
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
779368dd9b8bb20890b06229c4c3c3b5d153ee88d1af472799515cdc599c870a ac747d57c2a26b47644bca2a9b191b09f5180f6872dce9c3261c370a18c848a2