MCPcopy Create free account
hub / github.com/bootc-dev/bootc / test_source_name_validation

Function test_source_name_validation

crates/lib/src/loader_entries.rs:421–442  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

419
420 #[test]
421 fn test_source_name_validation() {
422 // (input, should_succeed)
423 let cases = [
424 ("tuned", true),
425 ("bootc-kargs-d", true),
426 ("my_source_123", true),
427 ("", false),
428 ("bad name", false),
429 ("bad/name", false),
430 ("bad.name", false),
431 ("foo@bar", false),
432 ];
433 for (input, expect_ok) in cases {
434 let result = SourceName::parse(input);
435 assert_eq!(
436 result.is_ok(),
437 expect_ok,
438 "SourceName::parse({input:?}) should {}",
439 if expect_ok { "succeed" } else { "fail" }
440 );
441 }
442 }
443
444 #[test]
445 fn test_source_name_bls_key() {

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected