use super::*;

#[test]
fn accepts_valid_action_keys() {
    for key in ["r", "c", "reset", "clear", "sync", "Q"] {
        assert!(validate_action_key(key).is_ok());
    }
}

#[test]
fn rejects_empty_action_key() {
    assert!(matches!(
        validate_action_key(""),
        Err(ConfigEasyError::InvalidActionKey(_))
    ));
}

#[test]
fn rejects_numeric_action_keys() {
    for key in ["1", "2", "10"] {
        assert!(matches!(
            validate_action_key(key),
            Err(ConfigEasyError::InvalidActionKey(_))
        ));
    }
}

#[test]
fn rejects_reserved_action_keys() {
    for key in ["q", "quit"] {
        assert!(matches!(
            validate_action_key(key),
            Err(ConfigEasyError::ReservedActionKey(_))
        ));
    }
}
