Skip to content

Commit 6b5151d

Browse files
committed
add regression test
1 parent 528499f commit 6b5151d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test-framework/e2e-tests/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![cfg(test)]
22

33
mod pty;
4+
mod regression;
45
mod su;
56

67
type Error = Box<dyn std::error::Error>;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use sudo_test::{Command, Env, TextFile};
2+
3+
use crate::Result;
4+
5+
#[test]
6+
fn syslog_writer_should_not_hang() -> Result<()> {
7+
let env = Env(TextFile("ALL ALL=(ALL:ALL) NOPASSWD: ALL").chmod("644")).build()?;
8+
9+
let stdout = Command::new("sudo")
10+
.args(["env", "CC=clang-18", "CXX=clang++-18", "FOO=\"........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................\"", "whoami"])
11+
.output(&env)?
12+
.stdout()?;
13+
14+
assert_eq!(stdout, "root");
15+
16+
Ok(())
17+
}

0 commit comments

Comments
 (0)