mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 06:47:40 +00:00
LibSQL: Test INSERT statement with wrong number of values
This commit is contained in:
parent
4df85840c3
commit
235573f7ba
1 changed files with 10 additions and 0 deletions
|
@ -104,6 +104,16 @@ TEST_CASE(insert_into_table_multiple_tuples_wrong_data_types)
|
||||||
EXPECT(result->error().code == SQL::SQLErrorCode::InvalidValueType);
|
EXPECT(result->error().code == SQL::SQLErrorCode::InvalidValueType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE(insert_wrong_number_of_values)
|
||||||
|
{
|
||||||
|
ScopeGuard guard([]() { unlink(db_name); });
|
||||||
|
auto database = SQL::Database::construct(db_name);
|
||||||
|
create_table(database);
|
||||||
|
auto result = execute(database, "INSERT INTO TestSchema.TestTable VALUES ( 42 );");
|
||||||
|
EXPECT(result->error().code == SQL::SQLErrorCode::InvalidNumberOfValues);
|
||||||
|
EXPECT(result->inserted() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE(select_from_table)
|
TEST_CASE(select_from_table)
|
||||||
{
|
{
|
||||||
ScopeGuard guard([]() { unlink(db_name); });
|
ScopeGuard guard([]() { unlink(db_name); });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue