include!("macro/macro.rs"); setup!(#[enum_tools(MIN, next)];); #[test] fn next_gapless() { use eg::EG; let mut cur = Some(EG::MIN); assert_eq!( ::core::iter::from_fn(|| { let res = cur; cur = cur.and_then(EG::next); res }) .collect::>(), vec![EG::A, EG::B, EG::C, EG::D] ); } #[test] fn next_with_holes() { use eh::EH; let mut cur = Some(EH::MIN); assert_eq!( ::core::iter::from_fn(|| { let res = cur; cur = cur.and_then(EH::next); res }) .collect::>(), vec![EH::A, EH::D, EH::C, EH::B] ); }