style: 修正新测试的格式以符合 rustfmt 宽度限制

cargo fmt 自动调整了 highlight.rs 与 error.rs 中新增测试的
assert! / assert_eq! 长行折行。
This commit is contained in:
xfy 2026-06-15 11:22:35 +08:00
parent 9fc626232c
commit 263208b930
2 changed files with 7 additions and 2 deletions

View File

@ -121,7 +121,10 @@ mod tests {
let err: ServerFnError = AppError::tx("deadlock detected on UPDATE posts").into();
let msg = err.to_string();
assert!(!msg.contains("UPDATE"), "should not leak SQL: {msg}");
assert!(!msg.contains("deadlock"), "should not leak error detail: {msg}");
assert!(
!msg.contains("deadlock"),
"should not leak error detail: {msg}"
);
assert!(msg.contains("操作失败"), "expected generic message: {msg}");
}

View File

@ -215,7 +215,9 @@ mod tests {
let result = highlight_code(code, Some("rust"));
// 两处 fn 关键字都应出现
assert_eq!(
result.matches(r#"<span class="storage type function rust">fn</span>"#).count(),
result
.matches(r#"<span class="storage type function rust">fn</span>"#)
.count(),
2
);
}