Implement ostree::checksum_file
This commit is contained in:
1 parent
4cd981d01b
commit
7f3bd56d0d
6 files changed
+60
-1
No files matched your search
@@ -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());
|
||||
}
|
||||
Reference in new issue
Block a user