1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:15:07 +00:00

LibSQL: Test SQL::Heap separately

Move the long storage test from TestSqlStatementExecution into a new
test unit called TestSqlHeap. Split it up into a flushed and non-flushed
variant so we test the write-ahead log as well.
This commit is contained in:
Jelle Raaijmakers 2023-05-24 12:30:31 +02:00 committed by Tim Flynn
parent d5df832318
commit 2d2911e1a3
3 changed files with 56 additions and 18 deletions

View file

@ -230,24 +230,6 @@ TEST_CASE(insert_with_placeholders)
}
}
TEST_CASE(insert_and_retrieve_long_text_value)
{
ScopeGuard guard([]() { unlink(db_name); });
auto database = SQL::Database::construct(db_name);
MUST(database->open());
create_table(database);
StringBuilder sb;
MUST(sb.try_append_repeated('x', 8192));
auto long_string = sb.string_view();
auto result = execute(database, DeprecatedString::formatted("INSERT INTO TestSchema.TestTable VALUES ('{}', 0);", long_string));
EXPECT(result.size() == 1);
result = execute(database, "SELECT TextColumn FROM TestSchema.TestTable;");
EXPECT_EQ(result.size(), 1u);
EXPECT_EQ(result[0].row[0], long_string);
}
TEST_CASE(select_from_empty_table)
{
ScopeGuard guard([]() { unlink(db_name); });