Skip to content

Commit

Permalink
add helper methods for health
Browse files Browse the repository at this point in the history
  • Loading branch information
bend-n committed Oct 11, 2023
1 parent 9259190 commit db32e7e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/libtest.rs
Expand Up @@ -99,13 +99,23 @@ impl TestEvent {
name
}

/// Get the stdout of this test, if available.
/// Get the stdout of this test, if available.
pub fn stdout(&self) -> Option<&str> {
match self {
Self::Ok { stdout, .. } | Self::Failed { stdout, .. } => stdout.as_deref(),
_ => None,
}
}

/// If this test is in progress.
pub fn in_progress(&self) -> bool {
matches!(self, Self::Started { .. })
}

/// If this test has finished
pub fn is_finished(&self) -> bool {
!self.in_progress()
}
}

#[derive(Debug, PartialEq, Deserialize, Serialize)]
Expand Down

0 comments on commit db32e7e

Please sign in to comment.