Skip to content

Commit

Permalink
CI: Fix nightly Rust, don't depend on panic message (#68)
Browse files Browse the repository at this point in the history
The panic message has changed in nightly Rust. Use more precise assertions instead of `#[should_panic(expected=...)]`
  • Loading branch information
intgr committed Sep 13, 2023
1 parent 46b979b commit a79ea5d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/iter.rs
Expand Up @@ -38,11 +38,16 @@ impl<'a> Iterator for RawACLIterator<'a> {

/** Demonstrate that multiple iterators cannot exist in parallel :( */
#[test]
#[should_panic(expected = "assertion failed: ")]
fn multi_iterator() {
let acl = PosixACL::new(0o640);
let iter1 = unsafe { acl.raw_iter() };
let iter2 = unsafe { acl.raw_iter() };

iter1.zip(iter2).for_each(|(a, b)| assert_eq!(a, b))
let results: Vec<_> = iter1.zip(iter2).collect();
// First item from each iterator is correct
assert_eq!(results[0].0, results[0].1);
// Then it gets out of whack
assert_ne!(results[1].0, results[1].1);

assert_eq!(results.len(), 2);
}

0 comments on commit a79ea5d

Please sign in to comment.