fix: apply rustfmt formatting

This commit is contained in:
lucaronin
2026-02-24 23:10:46 +01:00
parent 1cabd55d08
commit e40c4612d6
2 changed files with 20 additions and 5 deletions

View File

@@ -651,7 +651,10 @@ mod tests {
fn test_split_frontmatter_empty_block() {
// ---\n---\n (no fields between opening and closing ---)
let result = split_frontmatter("---\n---\n");
assert!(result.is_ok(), "split_frontmatter should handle empty frontmatter block");
assert!(
result.is_ok(),
"split_frontmatter should handle empty frontmatter block"
);
let (fm, rest) = result.unwrap();
assert_eq!(fm, "");
assert_eq!(rest, "\n");
@@ -661,14 +664,20 @@ mod tests {
fn test_split_frontmatter_empty_block_no_trailing_newline() {
// ---\n--- (no trailing newline)
let result = split_frontmatter("---\n---");
assert!(result.is_ok(), "split_frontmatter should handle empty frontmatter without trailing newline");
assert!(
result.is_ok(),
"split_frontmatter should handle empty frontmatter without trailing newline"
);
}
#[test]
fn test_split_frontmatter_empty_block_with_body() {
// ---\n---\n\n# Title\n
let result = split_frontmatter("---\n---\n\n# Title\n");
assert!(result.is_ok(), "split_frontmatter should handle empty frontmatter with body");
assert!(
result.is_ok(),
"split_frontmatter should handle empty frontmatter with body"
);
let (fm, rest) = result.unwrap();
assert_eq!(fm, "");
assert!(rest.contains("# Title"));
@@ -682,7 +691,10 @@ mod tests {
"title",
Some(FrontmatterValue::String("New Title".to_string())),
);
assert!(result.is_ok(), "update_frontmatter_content should handle empty frontmatter block");
assert!(
result.is_ok(),
"update_frontmatter_content should handle empty frontmatter block"
);
let updated = result.unwrap();
assert!(updated.contains("title: New Title"));
}

View File

@@ -427,7 +427,10 @@ mod tests {
expected_slug
);
assert!(!old_path.exists(), "old file should be removed");
assert!(Path::new(&result.new_path).exists(), "new file should exist");
assert!(
Path::new(&result.new_path).exists(),
"new file should exist"
);
fs::read_to_string(&result.new_path).unwrap()
}