|
@@ -17,6 +17,7 @@ use std::fmt;
|
|
pub enum ShortcutCommand {
|
|
pub enum ShortcutCommand {
|
|
Ready,
|
|
Ready,
|
|
Author,
|
|
Author,
|
|
|
|
+ Blocked,
|
|
}
|
|
}
|
|
|
|
|
|
#[derive(PartialEq, Eq, Debug)]
|
|
#[derive(PartialEq, Eq, Debug)]
|
|
@@ -39,6 +40,7 @@ impl ShortcutCommand {
|
|
let mut shortcuts = HashMap::new();
|
|
let mut shortcuts = HashMap::new();
|
|
shortcuts.insert("ready", ShortcutCommand::Ready);
|
|
shortcuts.insert("ready", ShortcutCommand::Ready);
|
|
shortcuts.insert("author", ShortcutCommand::Author);
|
|
shortcuts.insert("author", ShortcutCommand::Author);
|
|
|
|
+ shortcuts.insert("blocked", ShortcutCommand::Blocked);
|
|
|
|
|
|
let mut toks = input.clone();
|
|
let mut toks = input.clone();
|
|
if let Some(Token::Word(word)) = toks.peek_token()? {
|
|
if let Some(Token::Word(word)) = toks.peek_token()? {
|
|
@@ -92,3 +94,8 @@ fn test_4() {
|
|
Some(&ParseError::ExpectedEnd),
|
|
Some(&ParseError::ExpectedEnd),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+#[test]
|
|
|
|
+fn test_5() {
|
|
|
|
+ assert_eq!(parse("blocked"), Ok(Some(ShortcutCommand::Blocked)));
|
|
|
|
+}
|