Skip to content

Commit

Permalink
Merge pull request #35 from VolumeGraphics/swapped-nominal-actual
Browse files Browse the repository at this point in the history
Fix swapped actual and nominal for hash and text-compares
  • Loading branch information
TheAdiWijaya committed Jun 12, 2023
2 parents 9dba1a0 + 89e6bf6 commit d7f5df2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ rules:

## Changelog

### 0.3.1
- Fix swapped actual and nominal for hash and text-compares

### 0.3.0
- Allow RGBA image comparison
- Add file metadata comparison
Expand Down
6 changes: 3 additions & 3 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ impl Default for HashConfig {
}

pub fn compare_files<P: AsRef<Path>>(
actual_path: P,
nominal_path: P,
actual_path: P,
config: &HashConfig,
) -> Result<report::FileCompareResult, Error> {
let act = config
Expand All @@ -73,8 +73,8 @@ pub fn compare_files<P: AsRef<Path>>(
let diff = if act != nom {
vec![format!(
"Nominal file's hash is '{}' actual is '{}'",
HEXLOWER.encode(&act),
HEXLOWER.encode(&nom)
HEXLOWER.encode(&nom),
HEXLOWER.encode(&act)
)]
} else {
vec![]
Expand Down
2 changes: 1 addition & 1 deletion src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ pub enum Error {
}

pub fn compare_files<P: AsRef<Path>>(
actual_path: P,
nominal_path: P,
actual_path: P,
config: &HTMLCompareConfig,
) -> Result<report::FileCompareResult, Error> {
let actual = BufReader::new(fat_io_wrap_std(actual_path.as_ref(), &File::open)?);
Expand Down

0 comments on commit d7f5df2

Please sign in to comment.