init
Some checks failed
CI / ci (push) Failing after 1m48s

This commit is contained in:
2026-08-25 23:24:36 +02:00
commit 95739892de
466 changed files with 33918 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
use domain::entry::Content;
use domain::errors::DomainError;
#[test]
fn valid_content_is_created() {
let content = Content::new("went for a walk").unwrap();
assert_eq!(content.value(), "went for a walk");
}
#[test]
fn content_trims_whitespace() {
let content = Content::new(" hello world ").unwrap();
assert_eq!(content.value(), "hello world");
}
#[test]
fn empty_content_is_rejected() {
let result = Content::new("");
assert!(matches!(result, Err(DomainError::InvalidInput(_))));
}
#[test]
fn whitespace_only_content_is_rejected() {
let result = Content::new(" ");
assert!(matches!(result, Err(DomainError::InvalidInput(_))));
}
#[test]
fn from_persistence_bypasses_validation() {
let content = Content::from_persistence(String::new());
assert_eq!(content.value(), "");
}