From 5ff7bc790075190ee5917d898da20949d6a5045f Mon Sep 17 00:00:00 2001 From: Pietro Virgillito <6842434+RomanSurface@users.noreply.github.com> Date: Sat, 20 Dec 2025 16:01:36 +0100 Subject: [PATCH 1/2] Document behavior with duplicate keys Signed-off-by: Pietro Virgillito <6842434+RomanSurface@users.noreply.github.com> --- tests/integration_tests.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index cb6c1f35..1f18cd01 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -15,6 +15,9 @@ use std::convert::TryInto; use std::env::consts::ARCH; use std::thread; +use libc::SYS_read; + + // The type of the `req` parameter is different for the `musl` library. This will enable // successful build for other non-musl libraries. #[cfg(target_env = "musl")] @@ -789,3 +792,15 @@ fn test_filter_apply() { .join() .unwrap(); } + +#[test] +fn test_duplicate_syscall_keys_override_previous_rules() { + let rules = vec![ + (SYS_read, 1), + (SYS_read, 2), + ]; + + let map: BTreeMap<_, _> = rules.into_iter().collect(); + + assert_eq!(map.len(), 1); +} From e3144db11e5dac6045a07f93fb20c93cd377d9b3 Mon Sep 17 00:00:00 2001 From: Pietro Virgillito <6842434+RomanSurface@users.noreply.github.com> Date: Sat, 20 Dec 2025 16:16:33 +0100 Subject: [PATCH 2/2] fmt: apply rustfmt Signed-off-by: Pietro Virgillito <6842434+RomanSurface@users.noreply.github.com> --- tests/integration_tests.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 1f18cd01..b9c170f5 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -17,7 +17,6 @@ use std::thread; use libc::SYS_read; - // The type of the `req` parameter is different for the `musl` library. This will enable // successful build for other non-musl libraries. #[cfg(target_env = "musl")] @@ -795,10 +794,7 @@ fn test_filter_apply() { #[test] fn test_duplicate_syscall_keys_override_previous_rules() { - let rules = vec![ - (SYS_read, 1), - (SYS_read, 2), - ]; + let rules = vec![(SYS_read, 1), (SYS_read, 2)]; let map: BTreeMap<_, _> = rules.into_iter().collect();