mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
modify test files to read correct databases
This commit is contained in:
parent
a4b0ab2cbd
commit
c8db28052e
26 changed files with 34 additions and 34 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Aggregate Functions Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/agg-functions.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test select-avg {
|
||||
SELECT avg(age) FROM users;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ setup attach-db-query {
|
|||
|
||||
@setup attach-db-query
|
||||
test attach-db-query {
|
||||
ATTACH DATABASE "testing/testing_small.db" AS small;
|
||||
ATTACH DATABASE "database/testing_small.db" AS small;
|
||||
SELECT value FROM small.demo where id = 1;
|
||||
}
|
||||
expect {
|
||||
|
|
@ -24,7 +24,7 @@ setup detach-database {
|
|||
|
||||
@setup detach-database
|
||||
test detach-database {
|
||||
ATTACH DATABASE "testing/testing_small.db" AS small;
|
||||
ATTACH DATABASE "database/testing_small.db" AS small;
|
||||
DETACH DATABASE small;
|
||||
pragma database_list;
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ setup attach-cross-database-join {
|
|||
|
||||
@setup attach-cross-database-join
|
||||
test attach-cross-database-join {
|
||||
ATTACH DATABASE "testing/testing_small.db" as small;
|
||||
ATTACH DATABASE "database/testing_small.db" as small;
|
||||
create table joiners (id int, otherid int);
|
||||
insert into joiners (id, otherid) values (1,1);
|
||||
insert into joiners (id, otherid) values (3,3);
|
||||
|
|
@ -83,7 +83,7 @@ setup query-after-detach {
|
|||
|
||||
@setup query-after-detach
|
||||
test query-after-detach {
|
||||
ATTACH DATABASE "testing/testing_small.db" as small;
|
||||
ATTACH DATABASE "database/testing_small.db" as small;
|
||||
DETACH DATABASE small;
|
||||
select * from small.sqlite_schema;
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ setup attach-from-memory-db {
|
|||
|
||||
@setup attach-from-memory-db
|
||||
test attach-from-memory-db {
|
||||
ATTACH DATABASE 'testing/testing.db' as a;
|
||||
ATTACH DATABASE 'database/testing.db' as a;
|
||||
SELECT * from a.products, t LIMIT 1;
|
||||
}
|
||||
expect {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# ATTACH Tests (Readonly Small)
|
||||
# Ported from testing/attach.test
|
||||
|
||||
@database testing/testing_small.db readonly
|
||||
@database database/testing_small.db readonly
|
||||
|
||||
# Qualified table name access to main database
|
||||
test attach-main-qualified {
|
||||
|
|
@ -23,19 +23,19 @@ expect {
|
|||
|
||||
# Attach reserved name - main (should fail)
|
||||
test attach-reserved-main {
|
||||
ATTACH DATABASE "testing/testing_small.db" AS main
|
||||
ATTACH DATABASE "database/testing_small.db" AS main
|
||||
}
|
||||
expect error { in use }
|
||||
|
||||
# Attach reserved name - temp (should fail)
|
||||
test attach-reserved-temp {
|
||||
ATTACH DATABASE "testing/testing_small.db" AS temp
|
||||
ATTACH DATABASE "database/testing_small.db" AS temp
|
||||
}
|
||||
expect error { in use }
|
||||
|
||||
# Attach duplicate database name (should fail)
|
||||
test attach-duplicate-name {
|
||||
ATTACH DATABASE "testing/testing_small.db" as small;
|
||||
ATTACH DATABASE "testing/testing_small.db" as small;
|
||||
ATTACH DATABASE "database/testing_small.db" as small;
|
||||
ATTACH DATABASE "database/testing_small.db" as small;
|
||||
}
|
||||
expect error { in use }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Coalesce Tests (Readonly - uses existing users table)
|
||||
# Ported from testing/coalesce.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test coalesce-from-table {
|
||||
SELECT coalesce(NULL, 1) FROM users LIMIT 1;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Concat Tests (Readonly - uses existing products table)
|
||||
# Ported from testing/concat.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test concat-from-table {
|
||||
SELECT 'A good ' || name FROM products WHERE name = 'hat';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# GLOB Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/glob.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test glob-fn {
|
||||
SELECT name, glob('sweat*', name) FROM products;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# GROUP BY Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/groupby.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test group_by {
|
||||
SELECT u.first_name, sum(u.age) FROM users u GROUP BY u.first_name LIMIT 10;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Integrity Check Tests
|
||||
# Ported from testing/integrity_check.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Basic integrity check
|
||||
test integrity-check {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# JOIN Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/join.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test cross-join {
|
||||
select * from users, products limit 1;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# LIKE Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/like.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test like-fn {
|
||||
SELECT name, like('sweat%', name) FROM products;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Math Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/math.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test add-agg-int {
|
||||
SELECT sum(id) + 10 FROM products;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# OFFSET Tests (Readonly - uses users table)
|
||||
# Ported from testing/offset.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test select-offset-0 {
|
||||
SELECT id FROM users ORDER BY id LIMIT 1 OFFSET 0;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# ORDER BY Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/orderby.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test basic-order-by-asc {
|
||||
SELECT * FROM products ORDER BY price;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# PRAGMA Tests (Readonly)
|
||||
# Ported from testing/pragma.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Set cache size and check in same connection
|
||||
test pragma-set-cache-size {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Scalar Functions - DateTime Tests
|
||||
# Ported from testing/scalar-functions-datetime.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Date function tests
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Scalar Functions - Printf Tests
|
||||
# Ported from testing/scalar-functions-printf.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Basic string formatting
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Scalar Functions Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/scalar-functions.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test typeof-sum-integer {
|
||||
SELECT typeof(sum(age)) from users;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# SELECT Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/select.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test select-const-1 {
|
||||
SELECT 1;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# SUBQUERY Tests (Readonly - uses products/users tables)
|
||||
# Ported from testing/subquery.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
test subquery-inner-filter {
|
||||
select sub.loud_hat from (
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Time Extension Functions Tests
|
||||
# Ported from testing/time.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# time_date function tests
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Transaction Tests
|
||||
# Ported from testing/transactions.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Basic transaction IMMEDIATE
|
||||
test basic-tx-1 {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# VALUES Tests (Readonly)
|
||||
# Ported from testing/values.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Basic values
|
||||
test values-1 {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Vector Tests (Readonly)
|
||||
# Ported from testing/vector.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Vector functions valid
|
||||
test vector-functions-valid {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# WHERE Tests (Readonly - users/products tables)
|
||||
# Ported from testing/where.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Basic WHERE comparisons
|
||||
test where-clause-eq {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# WHERE Tests (Readonly Small - demo table)
|
||||
# Ported from testing/where.test
|
||||
|
||||
@database testing/testing_small.db readonly
|
||||
@database database/testing_small.db readonly
|
||||
|
||||
# NULL comparisons with demo table
|
||||
test where-is-null {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Window Function Tests (Readonly)
|
||||
# Ported from testing/window.test
|
||||
|
||||
@database testing/testing.db readonly
|
||||
@database database/testing.db readonly
|
||||
|
||||
# Basic partition by
|
||||
test window-partition-by {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue