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() {
374
374
) ;
375
375
}
376
376
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
+
377
389
#[ test]
378
390
fn resolve ( ) {
379
391
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 {
25
25
impl ConcernCommand {
26
26
pub fn parse < ' a > ( input : & mut Tokenizer < ' a > ) -> Result < Option < Self > , Error < ' a > > {
27
27
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 ( ) ? {
29
29
toks. next_token ( ) ?;
30
30
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
+
31
38
let title = toks. take_line ( ) ?. trim ( ) . to_string ( ) ;
32
39
33
40
if title. is_empty ( ) {
You can’t perform that action at this time.
0 commit comments