Implement ostree::checksum_file

This commit is contained in:
Felix Krull authored and Colin Walters committed 2022-05-06 12:53:54 -04:00
1 parent 4cd981d01b
commit 7f3bd56d0d
6 files changed
+60 -1

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
use gio::NONE_CANCELLABLE;
use glib::Cast;
use ostree::{checksum_file, ObjectType, RepoFile, RepoFileExt};
use util::TestRepo;
#[test]
fn should_checksum_file() {
let repo = TestRepo::new();
repo.test_commit("test");
let file = repo
.repo
.read_commit("test", NONE_CANCELLABLE)
.expect("read commit")
.0
.downcast::<RepoFile>()
.expect("downcast");
let result = checksum_file(&file, ObjectType::File, NONE_CANCELLABLE).expect("checksum file");
assert_eq!(file.get_checksum().unwrap(), result.to_string());
}
+1
View File
@@ -6,5 +6,6 @@ extern crate tempfile;
#[macro_use]
extern crate maplit;
mod functions;
mod repo;
mod util;