tests for on_demand

This commit is contained in:
Robert Habermeier
2017-04-07 19:35:39 +02:00
parent 5793bb8fac
commit 68ec7ae41e
4 changed files with 437 additions and 49 deletions

View File

@@ -108,9 +108,14 @@ mod timeout {
}
/// A request id.
#[cfg(not(test))]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)]
pub struct ReqId(usize);
#[cfg(test)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)]
pub struct ReqId(pub usize);
impl fmt::Display for ReqId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Request #{}", self.0)