From 9b81a7ed6a20935df959c3fd5c923548ed61d88b Mon Sep 17 00:00:00 2001 From: Angelo Fallaria Date: Tue, 15 Feb 2022 13:10:42 +0800 Subject: [PATCH] test: add another test for multiple ranges --- src/config.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/config.rs b/src/config.rs index 7fee9c7..3eb5081 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1209,6 +1209,38 @@ super + {shift,alt} + {c,d} ], ) } + + #[test] + fn test_multiple_ranges_numbers() -> std::io::Result<()> { + let contents = " +{control,super} + {1-3} + {notify-send, echo} {hello,how,are} + "; + + eval_config_test( + contents, + vec![ + Hotkey::new( + evdev::Key::KEY_1, + vec![Modifier::Control], + "notify-send hello".to_string(), + ), + Hotkey::new( + evdev::Key::KEY_2, + vec![Modifier::Control], + "notify-send how".to_string(), + ), + Hotkey::new( + evdev::Key::KEY_3, + vec![Modifier::Control], + "notify-send are".to_string(), + ), + Hotkey::new(evdev::Key::KEY_1, vec![Modifier::Super], "echo hello".to_string()), + Hotkey::new(evdev::Key::KEY_2, vec![Modifier::Super], "echo how".to_string()), + Hotkey::new(evdev::Key::KEY_3, vec![Modifier::Super], "echo are".to_string()), + ], + ) + } } #[cfg(test)]