From a6cf29d0e296b6eb33f4046ff3e35df2f5f7e376 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Thu, 12 Nov 2015 07:51:04 -0800 Subject: [PATCH] Add failing test for `data = None` --- tests/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/lib.rs b/tests/lib.rs index 2e4af02..280df2c 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -72,3 +72,13 @@ fn ping_pong() { // helpful for resolving what the problem is. let res: ResponseData = request(Method::Post, &(url("/ping"))[..], Some(req)).unwrap().unwrap(); } + +#[test] +#[allow(unused_variables)] +fn ping_pong_none_data() { + let server = StackListener::new(); + + // When this fails, the error I get it "called Option::unwrap() on a None value" which is not + // helpful for resolving what the problem is. + let res: ResponseData = request(Method::Post, &(url("/ping"))[..], None).unwrap().unwrap(); +}