Skip to content

Commit bb729a6

Browse files
committed
fix a logic bug
This should have been true, not false
1 parent d0f980b commit bb729a6

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn is_different<A: AsRef<Path>, B: AsRef<Path>>(a_base: A, b_base: B) -> Res
5656
continue;
5757
} else {
5858
// if one is a file and one is a directory, we have a difference!
59-
return Ok(false)
59+
return Ok(true)
6060
}
6161
}
6262

tests/fileanddir/dir1/name/.gitkeep

Whitespace-only changes.

tests/fileanddir/dir2/name

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
some text!

tests/smoke.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ fn binary_good() {
1818
#[test]
1919
fn binary_bad() {
2020
assert!(dir_diff::is_different("tests/binary/bad/dir1", "tests/binary/bad/dir2").unwrap());
21+
}
22+
23+
#[test]
24+
fn fileanddir() {
25+
assert!(dir_diff::is_different("tests/fileanddir/dir1", "tests/fileanddir/dir2").unwrap());
2126
}

0 commit comments

Comments
 (0)