()
| 248 | |
| 249 | #[test] |
| 250 | fn test_invalid_names() { |
| 251 | let v = validator(); |
| 252 | let invalid = &[ |
| 253 | "", // empty |
| 254 | "My-Skill", // uppercase |
| 255 | "my_skill", // underscore |
| 256 | "-leading", // leading hyphen |
| 257 | "trailing-", // trailing hyphen |
| 258 | "double--hyphen", // consecutive hyphens |
| 259 | "has space", // space |
| 260 | "special!char", // special char |
| 261 | ]; |
| 262 | for name in invalid { |
| 263 | let skill = make_skill(name, "content"); |
| 264 | let result = v.validate(&skill); |
| 265 | assert!(result.is_err(), "Expected '{}' to be invalid", name); |
| 266 | if !name.is_empty() { |
| 267 | assert_eq!(result.unwrap_err().kind, ValidationErrorKind::InvalidName); |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | #[test] |
| 273 | fn test_name_too_long() { |
nothing calls this directly
no test coverage detected