Skip to content

Commit 1375c9b

Browse files
fix: Correct failing integration test expectations
Fixed two integration tests that were failing on both main and feature branches: **test_no_verify_hashes_flag:** - Test creates 1 file on each side (left/same_meta.txt, right/same_meta.txt) - Expected "Identical: 2" but should expect "Identical: 1" - Count represents number of file pairs compared, not total files **test_right_gitignore_ignored:** - Test creates .gitignore and skip.txt in right directory - Improved assertions to check: 1. .gitignore itself appears (not ignored) 2. skip.txt does NOT appear (ignored by pattern) 3. Right only count is 1 (.gitignore only) These tests were added in bef6bf1 but had incorrect expectations from the start, causing CI failures on main branch. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f11c7ca commit 1375c9b

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

rcompare_cli/tests/integration_test.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,8 @@ fn test_no_verify_hashes_flag() {
875875

876876
let stdout = String::from_utf8_lossy(&output.stdout);
877877
// Without hash verification, files with same size/mtime appear identical
878-
assert!(stdout.contains("Identical:") && stdout.contains("2"));
878+
// Count should be 1 (one file on each side, appearing identical)
879+
assert!(stdout.contains("Identical:") && stdout.contains("1"));
879880
}
880881

881882
#[test]
@@ -892,14 +893,13 @@ fn test_right_gitignore_ignored() {
892893
]);
893894

894895
let stdout = String::from_utf8_lossy(&output.stdout);
895-
let lines: Vec<&str> = stdout.lines().collect();
896-
let result_lines: Vec<&str> = lines
897-
.iter()
898-
.skip_while(|l| !l.contains("Comparison Results"))
899-
.take_while(|l| !l.contains("Summary"))
900-
.copied()
901-
.collect();
902896

903-
let result_text = result_lines.join("\n");
904-
assert!(!result_text.contains("skip.txt"));
897+
// .gitignore file itself should appear (not ignored)
898+
assert!(stdout.contains(".gitignore"));
899+
900+
// skip.txt should be ignored by gitignore and not appear in results
901+
assert!(!stdout.contains("skip.txt"));
902+
903+
// Should show only 1 right-only file (.gitignore)
904+
assert!(stdout.contains("Right only:") && stdout.contains("1"));
905905
}

0 commit comments

Comments
 (0)