mod helper;
use helper::{
TestEnum,
TestEnum::{Int, Unit},
};
#[test]
#[allow(deprecated)] fn single_value_tuple_deprecated() {
assert_eq!(Int(123).ok_int(), Some(123));
assert_eq!(Unit.ok_int(), None);
assert_eq!(Int(123).int(), Some(123));
assert_eq!(Unit.int(), None);
}
#[test]
#[allow(deprecated)] fn multi_value_tuple_deprecated() {
assert_eq!(
TestEnum::new_tuple(123).ok_tuple(),
Some(("123".into(), 123))
);
assert_eq!(Unit.ok_tuple(), None);
}
#[test]
fn single_value_tuple() {
assert_eq!(Int(123).int(), Some(123));
assert_eq!(Unit.int(), None);
assert_eq!(Int(123).int(), Some(123));
assert_eq!(Unit.int(), None);
}
#[test]
fn multi_value_tuple() {
assert_eq!(TestEnum::new_tuple(123).tuple(), Some(("123".into(), 123)));
assert_eq!(Unit.tuple(), None);
}