mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-06-13 07:21:22 +00:00
Move a test from /tests to /src
This commit is contained in:
18
src/lib.rs
18
src/lib.rs
@ -3,6 +3,9 @@
|
||||
extern crate libc;
|
||||
extern crate sqlite3_sys as raw;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate temporary;
|
||||
|
||||
macro_rules! raise(
|
||||
($message:expr) => (return Err(::Error::from($message)));
|
||||
);
|
||||
@ -68,3 +71,18 @@ pub use statement::{Statement, Binding, Value};
|
||||
pub fn open(path: &std::path::Path) -> Result<Database> {
|
||||
Database::open(path)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
use temporary::Directory;
|
||||
|
||||
macro_rules! ok(
|
||||
($result:expr) => ($result.unwrap());
|
||||
);
|
||||
|
||||
pub fn setup() -> (PathBuf, Directory) {
|
||||
let directory = ok!(Directory::new("sqlite"));
|
||||
(directory.path().join("database.sqlite3"), directory)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user