Skip to content

Commit

Permalink
Merge pull request #133 from dandi/tuple-win
Browse files Browse the repository at this point in the history
Use itertools to simplify some test code
  • Loading branch information
jwodder committed May 20, 2024
2 parents d1e977f + 94d309a commit 2fe0742
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ pub(crate) static FAST_NOT_EXIST: &[&str] = &[".bzr", ".git", ".nols", ".svn"];
#[cfg(test)]
mod tests {
use super::*;
use itertools::Itertools;

#[test]
fn test_fast_not_exist_is_sorted() {
assert!(FAST_NOT_EXIST.windows(2).all(|ab| {
assert!(ab.len() == 2);
ab[0] < ab[1]
}));
assert!(FAST_NOT_EXIST.iter().tuple_windows().all(|(a, b)| a < b));
}
}

0 comments on commit 2fe0742

Please sign in to comment.