Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
add unit test to expose RealtimeLines not timing out
Lars Wirzenius committed 9 months ago
commit 04cc070cc5e6cec29c3d6bb5dfa474539020190c
parent 96c3b53309caebc74e1339982c19ee00a6162538
1 file changed +8 -0
modified src/timeoutcmd.rs
@@ -664,6 +664,14 @@ mod tests {
    }

    #[test]
+
    fn yes_to_stdout_while_reading_with_realtimelines() -> Result<(), Box<dyn std::error::Error>> {
+
        let (running, mut stdout) = setup("exec yes", SHORT_TIMEOUT, None)?;
+
        while stdout.line().is_some() {}
+
        assert!(matches!(running.wait(), Err(TimeoutError::TimedOut)));
+
        Ok(())
+
    }
+

+
    #[test]
    fn kill() -> Result<(), Box<dyn std::error::Error>> {
        let (running, _) = setup(
            "exec sleep 1000",