+
+#[cfg(test)]
+mod tests {
+ #[tokio::test]
+ async fn test_hello() {
+ let res = warp::test::request()
+ .path("/hello/rust")
+ .header("user-agent", "TestBrowser 0.1")
+ .reply(&super::api())
+ .await;
+ assert_eq!(res.status(), 200);
+ assert_eq!(res.body(), "Hello, rust from TestBrowser 0.1!");
+ }
+}