// Copyright 2018 Val Markovic // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. extern crate hamcrest2; mod has { use hamcrest2::prelude::*; #[test] fn has_with_some() { let var: Option = Some(5); assert_that!(var, has(5)); } #[test] fn has_with_none() { assert_that!(None, not(has(5))); } #[test] fn has_with_ok() { let var: Result = Ok(5); assert_that!(var, has(5)); } #[test] fn has_with_err() { let var: Result = Err("bad".to_string()); assert_that!(var, not(has(5))); } }