Skip to content

Commit 5881f65

Browse files
author
Pietro Virgillito
committed
Document behavior with duplicate keys when collecting into BTreeMap
1 parent c3cf77d commit 5881f65

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/integration_tests.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ use std::convert::TryInto;
1515
use std::env::consts::ARCH;
1616
use std::thread;
1717

18+
use libc::SYS_read;
19+
20+
1821
// The type of the `req` parameter is different for the `musl` library. This will enable
1922
// successful build for other non-musl libraries.
2023
#[cfg(target_env = "musl")]
@@ -789,3 +792,15 @@ fn test_filter_apply() {
789792
.join()
790793
.unwrap();
791794
}
795+
796+
#[test]
797+
fn test_duplicate_syscall_keys_override_previous_rules() {
798+
let rules = vec![
799+
(SYS_read, 1),
800+
(SYS_read, 2),
801+
];
802+
803+
let map: BTreeMap<_, _> = rules.into_iter().collect();
804+
805+
assert_eq!(map.len(), 1);
806+
}

0 commit comments

Comments
 (0)