diff options
| author | Teddy Wing | 2018-09-30 21:05:44 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-09-30 21:05:44 +0200 | 
| commit | 9af04b96a475777d2e177b2a55d5b4f7705244aa (patch) | |
| tree | 496c590bb24f63cfcdc8ce8d864122599e014721 /src/parser.rs | |
| parent | 80b44c8ec956eb808b54fa2e0252db8600c42658 (diff) | |
| download | dome-key-map-9af04b96a475777d2e177b2a55d5b4f7705244aa.tar.bz2 | |
Fill in `action_parses_map_with_multiple_modifiers()`
Make this test do something, validating that it parses multiple modifier
prefixes in a special key.
Diffstat (limited to 'src/parser.rs')
| -rw-r--r-- | src/parser.rs | 31 | 
1 files changed, 30 insertions, 1 deletions
| diff --git a/src/parser.rs b/src/parser.rs index a7a565b..51e15d8 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -631,7 +631,36 @@ mod tests {      }      #[test]      fn action_parses_map_with_multiple_modifiers() { -        // "one<C-l>two<D-s>three" +        let text = "<C-A-g><D-S-s><D-A-C-S-Home>"; + +        let expected = Action::Map(vec![ +            KeyboardKeyWithModifiers::new( +                KeyboardKey::Character(Character::new('g')), +                Some(vec![ +                    Flag::Control, +                    Flag::Alt, +                ]), +            ), +            KeyboardKeyWithModifiers::new( +                KeyboardKey::Character(Character::new('s')), +                Some(vec![ +                    Flag::Meta, +                    Flag::Shift, +                ]), +            ), +            KeyboardKeyWithModifiers::new( +                KeyboardKey::KeyCode(KeyCode::new(autopilot::key::KeyCode::Home)), +                Some(vec![ +                    Flag::Meta, +                    Flag::Alt, +                    Flag::Control, +                    Flag::Shift, +                ]), +            ), +        ]); +        let result = action_map().easy_parse(text).map(|t| t.0); + +        assert_eq!(result, Ok(expected));      }      #[test] | 
