0.0.1-alpha.5.fix.1

This commit is contained in:
2026-09-28 10:02:47 +02:00
parent c17b7068a3
commit a1b56af8ed
23 changed files with 427 additions and 55 deletions

View File

@@ -0,0 +1,27 @@
// file: crates/knowledge-domain-lib/unit_tests/source.rs
// version: 1
#[test]
fn source_id_rejects_empty_values() {
assert_eq!(crate::SourceId::new(" "), Err(crate::SourceIdError::Empty));
return;
}
#[test]
fn source_id_constructs_and_exposes_valid_values() {
let source_id = crate::SourceId::new("pgr");
assert_eq!(source_id.as_ref().map(crate::SourceId::as_str), Ok("pgr"));
return;
}
#[test]
fn content_sources_are_not_limited_to_three_repositories() {
let sources = [
crate::ContentSource::new("pgr", crate::ContentFamily::Pgr),
crate::ContentSource::new("howtos", crate::ContentFamily::Howto),
crate::ContentSource::new("snippets", crate::ContentFamily::Snippet),
crate::ContentSource::new("project-extra", crate::ContentFamily::ProjectLocal),
];
assert!(sources.iter().all(Result::is_ok));
return;
}