Allow tests to be run in any order.

This commit is contained in:
Madeorsk 2024-10-22 15:44:41 +02:00
parent 7e31368fa3
commit fee00d5bc9
Signed by: Madeorsk
GPG key ID: 677E51CA765BB79F
2 changed files with 3 additions and 2 deletions

View file

@ -11,6 +11,7 @@ CREATE TABLE models (
-- Insert default data. -- Insert default data.
INSERT INTO models(name, amount) VALUES ('test', 50); INSERT INTO models(name, amount) VALUES ('test', 50);
INSERT INTO models(name, amount) VALUES ('updatable', 33.12);
-- Create default composite models table. -- Create default composite models table.
CREATE TABLE composite_models ( CREATE TABLE composite_models (

View file

@ -250,7 +250,7 @@ test "repository element update" {
// Update a model's name. // Update a model's name.
try updateQuery.set(.{ .name = "newname" }); try updateQuery.set(.{ .name = "newname" });
try updateQuery.whereValue(usize, "id", "=", 1); try updateQuery.whereValue(usize, "id", "=", 2);
updateQuery.returningAll(); updateQuery.returningAll();
// Build SQL. // Build SQL.
@ -267,7 +267,7 @@ test "repository element update" {
// Check the updated model. // Check the updated model.
try std.testing.expectEqual(1, result.models.len); try std.testing.expectEqual(1, result.models.len);
try std.testing.expectEqual(1, result.models[0].id); try std.testing.expectEqual(2, result.models[0].id);
try std.testing.expectEqualStrings("newname", result.models[0].name); try std.testing.expectEqualStrings("newname", result.models[0].name);
} }