Cotton code
15 lines · 529 B · RustRaw
//! The name shape.use super::*;#[test]fn the_shape_of_a_name() {    assert!(name_pattern("alice"));    assert!(name_pattern("asha-2"));    assert!(name_pattern("1234-5678"));    assert!(!name_pattern("a"), "one character is shorter than the pattern");    assert!(!name_pattern("-alice"), "a name never opens with a hyphen");    assert!(!name_pattern("Alice"), "upper case is not the grammar");    assert!(!name_pattern(&"a".repeat(32)), "31 characters is the ceiling");    assert!(name_pattern(&"a".repeat(31)));}