Skip to content

Commit

Permalink
Update tests and changelog for 1e8be45
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Jul 21, 2024
1 parent 92fa3fb commit c2f4b1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Fixed an issue where files with no common content would show duplicate
hunks.

Fixed a performance issue when files had extremely long lines
(e.g. 100,000+ characters).

## 0.59 (released 20th July 2024)

### Diffing
Expand Down
17 changes: 9 additions & 8 deletions src/line_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ mod tests {
// Even though the word exists on both sides, it should still
// be treated as a change. We're doing a line-based diff and
// the lines are different.
let positions = change_positions("foo", " foo");
assert!(positions[0].kind.is_novel());
let mut positions = change_positions("foo", " foo");
let last_pos = positions.pop().unwrap();
assert!(last_pos.kind.is_novel());
}

#[test]
Expand All @@ -300,17 +301,17 @@ mod tests {

#[test]
fn test_novel_lhs_trailing_newlines() {
let positions = change_positions("foo\n", "");
let mut positions = change_positions("foo\n", "");

assert_eq!(positions.len(), 2);
assert!(positions[0].kind.is_novel());
let last_pos = positions.pop().unwrap();
assert!(last_pos.kind.is_novel());
}

#[test]
fn test_positions_novel_lhs() {
let positions = change_positions("foo", "");
let mut positions = change_positions("foo", "");

assert_eq!(positions.len(), 1);
assert!(positions[0].kind.is_novel());
let last_pos = positions.pop().unwrap();
assert!(last_pos.kind.is_novel());
}
}

0 comments on commit c2f4b1f

Please sign in to comment.