docs: 补齐各模块局部回归测试的输入与断言说明
This commit is contained in:
@@ -821,6 +821,7 @@ pub fn parse_color(value: &str) -> Result<Color> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
/// 旧文字JSON缺wrap_bounds仍走不换行命令;合法边界随DPI缩放,负宽度在发布验证中拒绝。
|
||||
fn text_wrap_bounds_validate_and_legacy_text_remains_unwrapped() {
|
||||
let mut command: RenderCommand = serde_json::from_str(
|
||||
r##"{"type":"text","x":0,"y":0,"value":"text","size":1,"color":"#000000"}"##,
|
||||
@@ -846,6 +847,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
/// 默认空文档可通过验证且没有结构根/绘图命令,支持初始状态与清空发布。
|
||||
fn empty_document_is_valid_and_blank() {
|
||||
let document = RenderDocument::default();
|
||||
document.validate().unwrap();
|
||||
@@ -854,6 +856,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// 检查六位色默认alpha255,八位色按RRGGBBAA解码,避免将末尾透明度当成首通道。
|
||||
fn parses_rgb_and_rgba_colors() {
|
||||
assert_eq!(
|
||||
parse_color("#102030").unwrap(),
|
||||
@@ -870,6 +873,7 @@ mod tests {
|
||||
mod window_projection_tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
/// 同会话窗口命令可累积,新会话发布先丢旧命令;clear重置runtime_session并清空所有原生命令。
|
||||
fn replacement_and_reset_discard_old_window_projections() {
|
||||
let mut state = NamespaceState::default();
|
||||
let command = crate::window::Command {
|
||||
|
||||
Reference in New Issue
Block a user