mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-21 04:43:49 +00:00
fix(ci): update source-pattern tests for the maxSizeBytes arg and fix clippy identity_op
- externalSqlFileStartup.test.ts and sqlLibraryImportEncoding.test.ts matched the old single-arg readExternalSqlFile(Snapshot) call; update the expected source strings to include the size-limit argument. - external_sql.rs: 1 * 1024 * 1024 triggers clippy::identity_op under the CI toolchain; simplify to 1024 * 1024.
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@ test("cold-start SQL files wait for restored tabs before opening", () => {
|
||||
|
||||
const openPathSource = appSource.slice(openPathStart, openPathEnd);
|
||||
const initializationWait = openPathSource.indexOf("await desktopOpenTabsRestorationBarrier?.settled");
|
||||
const fileRead = openPathSource.indexOf("api.readExternalSqlFileSnapshot(path)");
|
||||
const fileRead = openPathSource.indexOf("api.readExternalSqlFileSnapshot(path, externalSqlEditorMaxBytes(settingsStore.editorSettings.externalSqlEditorMaxMb))");
|
||||
const tabOpen = openPathSource.indexOf("queryStore.openExternalSqlFile");
|
||||
assert.ok(initializationWait >= 0);
|
||||
assert.ok(initializationWait < fileRead);
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ test("SQL library imports use the charset-aware external SQL reader", () => {
|
||||
const end = source.indexOf("async function chooseSyncDirectory", start);
|
||||
const handler = start >= 0 && end > start ? source.slice(start, end) : "";
|
||||
|
||||
assert.match(handler, /await api\.readExternalSqlFile\(path\)/);
|
||||
assert.match(handler, /await api\.readExternalSqlFile\(path, externalSqlEditorMaxBytes\(settingsStore\.editorSettings\.externalSqlEditorMaxMb\)\)/);
|
||||
assert.doesNotMatch(handler, /readTextFile/);
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use sha2::{Digest, Sha256};
|
||||
use tokio::io::AsyncReadExt;
|
||||
|
||||
const MAX_EXTERNAL_SQL_EDITOR_FILE_BYTES: u64 = 64 * 1024 * 1024;
|
||||
const MIN_EXTERNAL_SQL_EDITOR_FILE_BYTES: u64 = 1 * 1024 * 1024;
|
||||
const MIN_EXTERNAL_SQL_EDITOR_FILE_BYTES: u64 = 1024 * 1024;
|
||||
const MAX_EXTERNAL_SQL_EDITOR_FILE_BYTES_LIMIT: u64 = 4096 * 1024 * 1024;
|
||||
|
||||
fn clamp_external_sql_editor_limit(max_size_bytes: Option<u64>) -> u64 {
|
||||
|
||||
Reference in New Issue
Block a user