Skip to content

Commit e205627

Browse files
committed
add test for simple command alias
1 parent 7acba90 commit e205627

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/server/routes/webhooks/args.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ mod tests {
169169
arg2: Option<String> = "arg2",
170170
})
171171

172-
"bar" => Bar(BarArgs {
172+
"bar" | "bar-alias" => Bar(BarArgs {
173173
arg3: Option<String> = "arg3",
174174
})
175175

@@ -201,6 +201,7 @@ mod tests {
201201
})
202202
);
203203
test!("bar", TestCommand::Bar(BarArgs { arg3: None }));
204+
test!("bar-alias", TestCommand::Bar(BarArgs { arg3: None }));
204205
test!("", TestCommand::Baz(BazArgs { arg4: None }));
205206

206207
// Test if args are parsed correctly
@@ -230,6 +231,12 @@ mod tests {
230231
arg3: Some("foo \" bar".into()),
231232
})
232233
);
234+
test!(
235+
"bar-alias arg3=\"foo \\\" bar\"",
236+
TestCommand::Bar(BarArgs {
237+
arg3: Some("foo \" bar".into()),
238+
})
239+
);
233240
test!("arg4=42", TestCommand::Baz(BazArgs { arg4: Some(42) }));
234241

235242
// Test if invalid args are rejected

0 commit comments

Comments
 (0)