Skip to content

Commit

Permalink
add stdout helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
bend-n committed Oct 11, 2023
1 parent 162826a commit 9259190
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ impl TestEvent {
| Self::Timeout { name }) = self;
name
}

/// 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,
}
}
}

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

0 comments on commit 9259190

Please sign in to comment.