huskies: merge 961
This commit is contained in:
+19
-10
@@ -20,7 +20,7 @@ pub mod ops;
|
||||
/// Background shadow-write task — persists pipeline items to SQLite asynchronously.
|
||||
pub mod shadow_write;
|
||||
|
||||
pub use content_store::{all_content_ids, delete_content, read_content, write_content};
|
||||
pub use content_store::{ContentKey, all_content_ids, delete_content, read_content, write_content};
|
||||
pub use ops::{ItemMeta, delete_item, move_item_stage, next_item_number, write_item_with_content};
|
||||
pub use shadow_write::init;
|
||||
|
||||
@@ -217,17 +217,23 @@ mod tests {
|
||||
let markdown = "---\nname: Content Test\n---\n# Story\n";
|
||||
|
||||
// Write.
|
||||
write_content(story_id, markdown);
|
||||
assert_eq!(read_content(story_id).as_deref(), Some(markdown));
|
||||
write_content(ContentKey::Story(story_id), markdown);
|
||||
assert_eq!(
|
||||
read_content(ContentKey::Story(story_id)).as_deref(),
|
||||
Some(markdown)
|
||||
);
|
||||
|
||||
// Overwrite.
|
||||
let updated = "---\nname: Updated\n---\n# Updated Story\n";
|
||||
write_content(story_id, updated);
|
||||
assert_eq!(read_content(story_id).as_deref(), Some(updated));
|
||||
write_content(ContentKey::Story(story_id), updated);
|
||||
assert_eq!(
|
||||
read_content(ContentKey::Story(story_id)).as_deref(),
|
||||
Some(updated)
|
||||
);
|
||||
|
||||
// Delete.
|
||||
delete_content(story_id);
|
||||
assert!(read_content(story_id).is_none());
|
||||
delete_content(ContentKey::Story(story_id));
|
||||
assert!(read_content(ContentKey::Story(story_id)).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -327,7 +333,10 @@ mod tests {
|
||||
assert_eq!(view.depends_on(), &[100, 200]);
|
||||
|
||||
// Content is stored verbatim (no parsing, no rewrite).
|
||||
assert_eq!(read_content(story_id).as_deref(), Some(content));
|
||||
assert_eq!(
|
||||
read_content(ContentKey::Story(story_id)).as_deref(),
|
||||
Some(content)
|
||||
);
|
||||
}
|
||||
|
||||
/// Story 864: passing `ItemMeta::default()` against a content blob that
|
||||
@@ -371,7 +380,7 @@ mod tests {
|
||||
},
|
||||
);
|
||||
|
||||
let read_back = read_content(story_id).expect("content present");
|
||||
let read_back = read_content(ContentKey::Story(story_id)).expect("content present");
|
||||
assert_eq!(read_back, body, "plain content must be readable as-is");
|
||||
assert!(
|
||||
!read_back.trim_start().starts_with("---"),
|
||||
@@ -402,7 +411,7 @@ mod tests {
|
||||
None,
|
||||
);
|
||||
write_content(
|
||||
story_id,
|
||||
ContentKey::Story(story_id),
|
||||
"---\nname: Retry reset test\nretry_count: 3\n---\n",
|
||||
);
|
||||
let typed = crate::pipeline_state::read_typed(story_id)
|
||||
|
||||
Reference in New Issue
Block a user