Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
add unit test to expose RealtimeLines not timing out
Lars Wirzenius committed 8 months ago
commit 04cc070cc5e6cec29c3d6bb5dfa474539020190c
parent 96c3b53
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",