Skip to content

Add comprehensive test suite for runtime (layout + render) #22

@wangnaihe

Description

@wangnaihe

Module

w3cos-runtime

Description

The runtime crate (layout, render, window, state) has minimal tests. Add comprehensive unit tests.

Areas to Test

  • layout.rs: Verify Taffy layout computation for various Component trees (flex, grid, nested)
  • state.rs: Already has 6 tests, but add edge cases (multiple signals, concurrent access patterns)
  • render.rs: Snapshot tests — render a Component to a Pixmap and verify pixel values at key positions
  • Integration: Build a Component tree with signals + onClick, verify state changes propagate

Acceptance Criteria

  • At least 20 new tests across layout/render/state
  • Test edge cases (empty trees, deeply nested, zero-size components)
  • All tests pass with cargo test -p w3cos-runtime
  • No new clippy warnings

Difficulty

Medium

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions