From 467067459c97496adfc2d8fda939875351f49fc2 Mon Sep 17 00:00:00 2001 From: EdenQwQ Date: Sun, 13 Feb 2022 18:40:17 +0800 Subject: [PATCH] [test] config: test for should work aliases (just to make sure) --- src/config.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/config.rs b/src/config.rs index 88eb9ac..e6d4702 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1372,6 +1372,35 @@ ctal + t firefox"; eval_invalid_config_test(contents, ParseError::UnknownSymbol(5)) } + + #[test] + fn test_longer_alias_example() -> std::io::Result<()> { + let contents = " +# Longer example +alias pls=doas +alias ctal = control + alt +alias ctals = ctal + shift +alias hello = #hello +ctal + f hello + firefox +ctals + b + brave hello"; + eval_config_test( + contents, + vec![ + Hotkey::new( + evdev::Key::KEY_F, + vec![Modifier::Control, Modifier::Alt], + "firefox".to_string(), + ), + Hotkey::new( + evdev::Key::KEY_B, + vec![Modifier::Control, Modifier::Alt, Modifier::Shift], + "brave #hello".to_string(), + ), + ], + ) + } } #[cfg(test)]