use crate::config::owner::is_owner;
#[test]
fn plus_in_bot_owner_matches_bare_digits() {
let allowed = vec!["+15551234567".to_string()];
let owners = vec!["+15551234567".to_string()];
assert!(is_owner(&allowed, &owners, "15551234567"));
}
#[test]
fn bare_bot_owner_matches_plus_prefixed_user() {
let allowed = vec!["15551234567".to_string()];
let owners = vec!["15551234567".to_string()];
assert!(is_owner(&allowed, &owners, "+15551234567"));
}
#[test]
fn plus_in_positional_fallback_matches() {
let allowed = vec!["+15551234567".to_string(), "15550009999".to_string()];
assert!(is_owner(&allowed, &[], "15551234567"));
assert!(!is_owner(&allowed, &[], "15550009999"));
}
#[test]
fn non_owner_still_rejected() {
let allowed = vec!["+15551234567".to_string()];
let owners = vec!["+15551234567".to_string()];
assert!(!is_owner(&allowed, &owners, "15550000000"));
}
#[test]
fn open_mode_unchanged() {
assert!(is_owner(&[], &[], "anyone"));
}