MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_invalid_names

Function test_invalid_names

core/src/skills/validator.rs:250–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 4

validatorFunction · 0.85
make_skillFunction · 0.85
validateMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected