mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 23:02:31 +03:00
7941db2b2f
This reverts commit423b27c11a
, reversing changes made tob39779366f
.
21 lines
649 B
Rust
21 lines
649 B
Rust
use crate::shared::temp_dir;
|
|
use gitbutler::database::Database;
|
|
|
|
#[test]
|
|
fn smoke() {
|
|
let data_dir = temp_dir();
|
|
let db = Database::open_in_directory(data_dir.path()).unwrap();
|
|
db.transaction(|tx| {
|
|
tx.execute("CREATE TABLE test (id INTEGER PRIMARY KEY)", [])
|
|
.unwrap();
|
|
tx.execute("INSERT INTO test (id) VALUES (1)", []).unwrap();
|
|
let mut stmt = tx.prepare("SELECT id FROM test").unwrap();
|
|
let mut rows = stmt.query([]).unwrap();
|
|
let row = rows.next().unwrap().unwrap();
|
|
let id: i32 = row.get(0).unwrap();
|
|
assert_eq!(id, 1_i32);
|
|
Ok(())
|
|
})
|
|
.unwrap();
|
|
}
|