use alpha_id::model::{Filter, Tags, Mode}; #[test] fn filter_billable_only_rejects_non_primary() { let tags = Tags { billable: false, valid: true, chapter: "I".into(), exotic: false }; let f = Filter { billable_only: true, valid_only: false, chapters: None, exclude_exotic: false }; assert!(!f.accepts(&tags)); } #[test] fn filter_default_accepts_everything() { let tags = Tags { billable: false, valid: false, chapter: "II".into(), exotic: true }; assert!(Filter::default().accepts(&tags)); } #[test] fn mode_parses_from_str() { assert_eq!("lexical".parse::().unwrap(), Mode::Lexical); assert_eq!("hybrid".parse::().unwrap(), Mode::Hybrid); } #[test] fn mode_letter_aliases_still_parse_to_new_variants() { // The legacy `c`/`a` CLI tokens remain accepted aliases (case-insensitive) // for the renamed canonical `lexical`/`hybrid` modes. assert_eq!("c".parse::().unwrap(), Mode::Lexical); assert_eq!("a".parse::().unwrap(), Mode::Hybrid); assert_eq!("A".parse::().unwrap(), Mode::Hybrid); }