Skip to content

Commit 2bc316d

Browse files
committed
missing unit tests related to 'list' pseudocommand
1 parent a62a153 commit 2bc316d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/sudoers/test/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ fn permission_test() {
262262
// apparmor
263263
#[cfg(feature = "apparmor")]
264264
pass!(["ALL ALL=(ALL:ALL) APPARMOR_PROFILE=unconfined ALL"], "user" => root(), "server"; "/bin/bar" => [apparmor_profile: Some("unconfined".to_string())]);
265+
266+
// list
267+
pass!(["ALL ALL=(ALL:ALL) /bin/ls, list"], "user" => root(), "server"; "list");
268+
FAIL!(["ALL ALL=(ALL:ALL) ALL, !list"], "user" => root(), "server"; "list");
265269
}
266270

267271
#[test]
@@ -385,6 +389,12 @@ fn sudoedit_recognized() {
385389
assert_eq!(args.unwrap().as_ref(), &["/etc/tmux.conf"][..]);
386390
}
387391

392+
#[test]
393+
#[should_panic = "list does not take arguments"]
394+
fn list_does_not_take_args() {
395+
parse_eval::<ast::CommandSpec>("list /etc/tmux.conf");
396+
}
397+
388398
#[test]
389399
fn directive_test() {
390400
let y = parse_eval::<Spec<UserSpecifier>>;

0 commit comments

Comments
 (0)