mirror of
https://github.com/demostf/cutter.git
synced 2026-06-03 11:54:08 +02:00
snapshot test
This commit is contained in:
parent
cdffdf511a
commit
b164b4621b
3 changed files with 23 additions and 1 deletions
19
tests/snapshot.rs
Normal file
19
tests/snapshot.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use democutter::cut;
|
||||
use expect_test::{expect_file, ExpectFile};
|
||||
use std::fs;
|
||||
|
||||
fn snapshot(path: &str, expect: ExpectFile) {
|
||||
let file = fs::read(path).unwrap();
|
||||
let output = cut(&file, 30000, 50000);
|
||||
let output_md5 = md5::compute(&output);
|
||||
|
||||
expect.assert_eq(&format!("{:x}", output_md5));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn snapshot_gully() {
|
||||
snapshot(
|
||||
"test_data/gully.dem",
|
||||
expect_file!["../test_data/gully_cut.md5"],
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue