mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-01 07:35:02 +03:00
LibSQL: Add an INSERT without column names test
This adds a passing test of an insert statement that contains no column names and assumes full tuple input
This commit is contained in:
parent
235573f7ba
commit
0e5b2c923d
Notes:
sideshowbarker
2024-07-18 03:04:25 +09:00
Author: https://github.com/i3abghany Commit: https://github.com/SerenityOS/serenity/commit/0e5b2c923df Pull-request: https://github.com/SerenityOS/serenity/pull/10091 Issue: https://github.com/SerenityOS/serenity/issues/10028 Reviewed-by: https://github.com/JanDeVisser Reviewed-by: https://github.com/davidot ✅ Reviewed-by: https://github.com/trflynn89
@ -114,6 +114,19 @@ TEST_CASE(insert_wrong_number_of_values)
|
||||
EXPECT(result->inserted() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE(insert_without_column_names)
|
||||
{
|
||||
ScopeGuard guard([]() { unlink(db_name); });
|
||||
auto database = SQL::Database::construct(db_name);
|
||||
create_table(database);
|
||||
auto result = execute(database, "INSERT INTO TestSchema.TestTable VALUES ('Test_1', 42), ('Test_2', 43);");
|
||||
EXPECT(result->error().code == SQL::SQLErrorCode::NoError);
|
||||
EXPECT(result->inserted() == 2);
|
||||
|
||||
auto table = database->get_table("TESTSCHEMA", "TESTTABLE");
|
||||
EXPECT_EQ(database->select_all(*table).size(), 2u);
|
||||
}
|
||||
|
||||
TEST_CASE(select_from_table)
|
||||
{
|
||||
ScopeGuard guard([]() { unlink(db_name); });
|
||||
|
Loading…
Reference in New Issue
Block a user