Skip to content

Commit 16b7135

Browse files
committed
fix extension tests
1 parent 0878396 commit 16b7135

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

testing/cli_tests/extensions.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,18 @@ def test_crypto():
312312
)
313313
turso.run_test_fn(
314314
"SELECT crypto_encode(crypto_sha384('abc'), 'hex');",
315-
lambda a: a
316-
== "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7",
315+
lambda a: (
316+
a == "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7"
317+
),
317318
"sha384 should encrypt correctly",
318319
)
319320
turso.run_test_fn(
320321
"SELECT crypto_encode(crypto_sha512('abc'), 'hex');",
321-
lambda a: a
322-
== "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", # noqa: E501
322+
lambda a: (
323+
a
324+
== "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a"
325+
+ "836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"
326+
), # noqa: E501
323327
"sha512 should encrypt correctly",
324328
)
325329

@@ -404,14 +408,8 @@ def _test_series(limbo: TestTursoShell):
404408
"SELECT * FROM generate_series(10, 1, -2);",
405409
lambda res: res == "10\n8\n6\n4\n2",
406410
)
407-
limbo.run_test_fn(
408-
"SELECT * FROM generate_series(-1, 2);",
409-
lambda res: res == "-1\n0\n1\n2"
410-
)
411-
limbo.run_test_fn(
412-
"SELECT * FROM generate_series(-3, -1);",
413-
lambda res: res == "-3\n-2\n-1"
414-
)
411+
limbo.run_test_fn("SELECT * FROM generate_series(-1, 2);", lambda res: res == "-1\n0\n1\n2")
412+
limbo.run_test_fn("SELECT * FROM generate_series(-3, -1);", lambda res: res == "-3\n-2\n-1")
415413
limbo.run_test_fn(
416414
"SELECT * FROM generate_series(b.start, b.stop) b;",
417415
lambda res: "Invalid Argument" in res or 'first argument to "generate_series()" missing or unusable' in res,
@@ -522,7 +520,7 @@ def _test_kv(exec_name, ext_path):
522520
turso.run_test_fn("alter table t rename to renamed;", lambda res: "" == res, "can rename virtual table")
523521
turso.run_test_fn(
524522
"select sql from sqlite_schema where name = 'renamed';",
525-
lambda res: "CREATE VIRTUAL TABLE renamed USING kv_store ()",
523+
lambda res: 'CREATE VIRTUAL TABLE "renamed" USING kv_store',
526524
"renamed table shows up in sqlite_schema",
527525
)
528526
turso.quit()
@@ -790,38 +788,38 @@ def test_csv():
790788
test_module_list(turso, "target/debug/liblimbo_csv", "csv")
791789

792790
turso.run_test_fn(
793-
"CREATE VIRTUAL TABLE temp.csv USING csv(filename=./testing/cli_tests/test_files/test.csv);",
791+
"CREATE VIRTUAL TABLE csv USING csv(filename=./testing/cli_tests/test_files/test.csv);",
794792
null,
795793
"Create virtual table from CSV file",
796794
)
797795
turso.run_test_fn(
798-
"SELECT * FROM temp.csv;",
796+
"SELECT * FROM csv;",
799797
lambda res: res == "1|2.0|String'1\n3|4.0|String2",
800798
"Read all rows from CSV table",
801799
)
802800
turso.run_test_fn(
803-
"SELECT * FROM temp.csv WHERE c2 = 'String2';",
801+
"SELECT * FROM csv WHERE c2 = 'String2';",
804802
lambda res: res == "3|4.0|String2",
805803
"Filter rows with WHERE clause",
806804
)
807805
turso.run_test_fn(
808-
"INSERT INTO temp.csv VALUES (5, 6.0, 'String3');",
806+
"INSERT INTO csv VALUES (5, 6.0, 'String3');",
809807
lambda res: "Table is read-only" in res,
810808
"INSERT into CSV table should fail",
811809
)
812810
turso.run_test_fn(
813-
"UPDATE temp.csv SET c0 = 10 WHERE c1 = '2.0';",
811+
"UPDATE csv SET c0 = 10 WHERE c1 = '2.0';",
814812
lambda res: "is read-only" in res,
815813
"UPDATE on CSV table should fail",
816814
)
817815
turso.run_test_fn(
818-
"DELETE FROM temp.csv WHERE c1 = '2.0';",
816+
"DELETE FROM csv WHERE c1 = '2.0';",
819817
lambda res: "is read-only" in res,
820818
"DELETE on CSV table should fail",
821819
)
822-
turso.run_test_fn("DROP TABLE temp.csv;", null, "Drop CSV table")
820+
turso.run_test_fn("DROP TABLE csv;", null, "Drop CSV table")
823821
turso.run_test_fn(
824-
"SELECT * FROM temp.csv;",
822+
"SELECT * FROM csv;",
825823
lambda res: "Parse error: no such table: csv" in res,
826824
"Query dropped CSV table should fail",
827825
)

testing/differential-oracle/sql_gen_prop/create_index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn create_index_for_table(
159159
_ => None,
160160
};
161161
let qualified_index_name = match index_database.as_deref() {
162-
Some("temp") => index_name.clone(),
162+
Some("temp") => index_name,
163163
Some(db) => format!("{db}.{index_name}"),
164164
None => index_name,
165165
};
@@ -263,7 +263,7 @@ pub fn create_index(
263263
_ => None,
264264
};
265265
let qualified_index_name = match index_database.as_deref() {
266-
Some("temp") => index_name.clone(),
266+
Some("temp") => index_name,
267267
Some(db) => format!("{db}.{index_name}"),
268268
None => index_name,
269269
};

0 commit comments

Comments
 (0)