~gbmor/clinte

567a66d30fb86ad144e3deec256e27d05a611c2d — Ben Morrison 1 year, 10 months ago b50586f
error helper test
1 files changed, 19 insertions(+), 0 deletions(-)

M src/error.rs
M src/error.rs => src/error.rs +19 -0
@@ 10,3 10,22 @@ where
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn shouldnt_panic() {
        let ok: Result<&str, &str> = Ok("okay");
        let rhs = helper(ok);
        assert_eq!("okay", rhs);
    }

    #[test]
    #[should_panic]
    fn should_panic() {
        let err: Result<&str, &str> = Err("oops");
        helper(err);
    }
}