0.0.1-alpha.3.fix.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/knowledge-domain-lib/src/source.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Source identities independent of repository and forge providers.
|
||||
|
||||
@@ -30,7 +30,7 @@ impl crate::SourceId {
|
||||
if value.trim().is_empty() {
|
||||
return Err(crate::SourceIdError::Empty);
|
||||
}
|
||||
return Ok(crate::SourceId(value.to_owned()));
|
||||
return Ok(Self(value.to_owned()));
|
||||
}
|
||||
|
||||
/// Return the identifier as text.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/knowledge-domain-lib/src/unit_tests.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#[test]
|
||||
fn source_id_rejects_empty_values() {
|
||||
@@ -7,6 +7,13 @@ fn source_id_rejects_empty_values() {
|
||||
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 = [
|
||||
|
||||
Reference in New Issue
Block a user