Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading