diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-05-18 16:28:22 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-05-18 16:28:22 -0400 |
| commit | 508b6e3d77fb1c671bb3ebd6ef760ef25da2c9cc (patch) | |
| tree | d2123e6411523da220fe2326654f6efffd492322 /src/main.rs | |
| parent | 491aba6f20d3064fe779fffe265a603591d552ae (diff) | |
Test `import_file`.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 54ab708..033f562 100644 --- a/src/main.rs +++ b/src/main.rs @@ -150,11 +150,24 @@ mod tests { .unwrap() .exists(params![table]) .unwrap(); - if !exists { - panic!("Table {} did not exist", table); - } + assert!(exists); } } + + #[test] + fn insert_file() { + let tb = TagBase::make_temporary().unwrap(); + let id = tb + .import_image(Path::new("/fake/path"), "fakehash") + .unwrap(); + let exists = tb + .conn + .prepare("SELECT filename, blake2 FROM images WHERE id = ?;") + .unwrap() + .exists(params![id]) + .unwrap(); + assert!(exists); + } } fn main() { |