File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,18 @@ fn concern() {
374374 ) ;
375375}
376376
377+ #[ test]
378+ fn concern_resolve ( ) {
379+ let input = "@bot concern resolve this is my concern" ;
380+ let mut input = Input :: new ( input, vec ! [ "bot" ] ) ;
381+ assert_eq ! (
382+ input. next( ) ,
383+ Some ( Command :: Concern ( Ok ( concern:: ConcernCommand :: Resolve {
384+ title: "this is my concern" . to_string( )
385+ } ) ) )
386+ ) ;
387+ }
388+
377389#[ test]
378390fn resolve ( ) {
379391 let input = "@bot resolve this is my concern" ;
Original file line number Diff line number Diff line change @@ -25,9 +25,16 @@ impl fmt::Display for ParseError {
2525impl ConcernCommand {
2626 pub fn parse < ' a > ( input : & mut Tokenizer < ' a > ) -> Result < Option < Self > , Error < ' a > > {
2727 let mut toks = input. clone ( ) ;
28- if let Some ( Token :: Word ( action @ ( "concern" | "resolve" ) ) ) = toks. peek_token ( ) ? {
28+ if let Some ( Token :: Word ( mut action @ ( "concern" | "resolve" ) ) ) = toks. peek_token ( ) ? {
2929 toks. next_token ( ) ?;
3030
31+ if action == "concern" {
32+ if let Some ( Token :: Word ( sub_action @ "resolve" ) ) = toks. peek_token ( ) ? {
33+ toks. next_token ( ) ?;
34+ action = sub_action;
35+ }
36+ }
37+
3138 let title = toks. take_line ( ) ?. trim ( ) . to_string ( ) ;
3239
3340 if title. is_empty ( ) {
You can’t perform that action at this time.
0 commit comments