Skip to content

Commit

Permalink
test multiple calls to serve panics
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Bond <[email protected]>
  • Loading branch information
loshz committed Jun 6, 2022
1 parent d91f3c5 commit 0574792
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ fn test_new_server_invalid_key() {
let _ = MetricsServer::new("localhost:8442", Some(cert), Some(key));
}

#[test]
#[should_panic]
fn test_new_server_already_running() {
let srv = MetricsServer::new("localhost:8002", None, None).serve();

// Attempt to start an already running server.
srv.serve();
}

#[test]
fn test_new_https_server() {
// Load TLS config.
Expand Down

0 comments on commit 0574792

Please sign in to comment.