use super::*;

#[test]
fn accepts_valid_identifiers() {
    for identifier in [
        "settings",
        "key",
        "value",
        "display_order",
        "_private",
        "a1",
    ] {
        assert!(validate_identifier(identifier).is_ok());
    }
}

#[test]
fn rejects_invalid_identifiers() {
    for identifier in [
        "",
        "1key",
        "key desc",
        "foo.bar",
        "\"settings\"",
        "settings; DROP TABLE settings",
        "has-dash",
    ] {
        assert!(validate_identifier(identifier).is_err());
    }
}
