MCPcopy Create free account
hub / github.com/chatmail/core / test_auto_vacuum

Function test_auto_vacuum

src/sql/sql_tests.rs:48–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46/// Tests that auto_vacuum is enabled for new databases.
47#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
48async fn test_auto_vacuum() -> Result<()> {
49 let t = TestContext::new().await;
50
51 let query_only = true;
52 let auto_vacuum = t
53 .sql
54 .call(query_only, |conn| {
55 let auto_vacuum = conn.pragma_query_value(None, "auto_vacuum", |row| {
56 let auto_vacuum: i32 = row.get(0)?;
57 Ok(auto_vacuum)
58 })?;
59 Ok(auto_vacuum)
60 })
61 .await?;
62
63 // auto_vacuum=2 is the same as auto_vacuum=INCREMENTAL
64 assert_eq!(auto_vacuum, 2);
65 Ok(())
66}
67
68#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
69async fn test_housekeeping_db_closed() {

Callers

nothing calls this directly

Calls 2

callMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected