Skip to content

Commit f4e6826

Browse files
bjacotgcopybara-github
authored andcommitted
Increase MAX_DISTANCE to 50.
Fairly short strings (~15 lines) with a single diff on each line (e.g. missing indentation) would still fails as it will generate a distance of ~30. PiperOrigin-RevId: 586592677
1 parent 15fc0be commit f4e6826

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

googletest/src/matcher_support/edit_distance.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::fmt::Debug;
1919
///
2020
/// Increasing this limit increases the accuracy of [`edit_list`] while
2121
/// quadratically increasing its worst-case runtime.
22-
const MAX_DISTANCE: i32 = 25;
22+
const MAX_DISTANCE: i32 = 50;
2323

2424
/// The difference between two inputs as produced by [`edit_list`].
2525
#[derive(Debug)]
@@ -533,7 +533,7 @@ mod tests {
533533

534534
#[test]
535535
fn returns_unrelated_when_maximum_distance_exceeded() -> Result<()> {
536-
let result = edit_list(0..=20, 20..40, Mode::Exact);
536+
let result = edit_list(0..=50, 60..110, Mode::Exact);
537537
verify_that!(result, matches_pattern!(Difference::Unrelated))
538538
}
539539

0 commit comments

Comments
 (0)