From 392f2059a0b5856e16fe00d8ac4258d2491fd0b7 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Tue, 7 Nov 2023 15:42:20 -0500 Subject: [PATCH] add test for random rowid --- libsql-server/tests/standalone/mod.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libsql-server/tests/standalone/mod.rs b/libsql-server/tests/standalone/mod.rs index e26cf52c44..1d85035cf7 100644 --- a/libsql-server/tests/standalone/mod.rs +++ b/libsql-server/tests/standalone/mod.rs @@ -201,3 +201,25 @@ fn execute_transaction() { sim.run().unwrap(); } + +#[test] +fn random_rowid() { + let mut sim = turmoil::Builder::new().build(); + + sim.host("primary", make_standalone_server); + + sim.client("test", async { + let db = Database::open_remote_with_connector("http://primary:8080", "", TurmoilConnector)?; + let conn = db.connect()?; + + conn.execute( + "CREATE TABLE shopping_list(item text, quantity int) RANDOM ROWID", + (), + ) + .await?; + + Ok(()) + }); + + sim.run().unwrap(); +}