Skip to content

test: comprehensive v0.8 API coverage (250 tests) - so we can copy these to main later and know what broke. #154

Open
lilith wants to merge 2 commits intokornelski:v0.8from
lilith:api-coverage-v08
Open

test: comprehensive v0.8 API coverage (250 tests) - so we can copy these to main later and know what broke. #154
lilith wants to merge 2 commits intokornelski:v0.8from
lilith:api-coverage-v08

Conversation

@lilith
Copy link
Contributor

@lilith lilith commented Mar 4, 2026

Exercises the entire v0.8 public API surface:

  • All pixel types (RGB, BGR, GRB, RGBA, BGRA, ARGB, ABGR, Gray, GrayAlpha, GrayA)
  • All traits (ComponentMap, ColorComponentMap, ComponentSlice, ComponentBytes, AsPixels, FromSlice)
  • All inherent methods (new, value, with_alpha, map_alpha, map_gray, rgb, bgr, iter, etc.)
  • All From/Into conversions (layout reordering, type widening, gray-to-rgb, array, tuple)
  • All operator impls (Add, Sub, Mul, Div, and Assign variants, Sum)
  • All formatting (Display, UpperHex, LowerHex)
  • Derive impls (Clone, Copy, Debug, Default, Eq, PartialOrd, Hash)
  • Feature-gated: as-bytes, bytemuck, serde, checked_fns
  • AsRef/AsMut impls
  • Memory layout verification

Preliminary discoveries vs main:

  1. map_colors() → map_c() — ColorComponentMap renamed its method
  2. AsRef<[T]> → AsRef<[T; N]> — RGB/RGBA AsRef returns fixed-size arrays now, not slices
  3. Hex formatting — "RGB { #FF0000 }" → "#FF0000" (wrapper removed), BGR hex prints r,g,b semantic order instead of b,g,r memory order,
    u16 components now get 4-digit padding
  4. BGRA display — "bgra(r,g,b,a)" → "bgra(b,g,r,a)" (now prints in struct field order)
  5. Gray::with_alpha() — removed on main
  6. Prelude — exports Pixel/HetPixel/HasAlpha/GainAlpha/ArrayLike instead of ComponentMap/ColorComponentMap

lilith added 2 commits March 4, 2026 00:19
Exercises the entire v0.8 public API surface:
- All pixel types (RGB, BGR, GRB, RGBA, BGRA, ARGB, ABGR, Gray, GrayAlpha, GrayA)
- All traits (ComponentMap, ColorComponentMap, ComponentSlice, ComponentBytes, AsPixels, FromSlice)
- All inherent methods (new, value, with_alpha, map_alpha, map_gray, rgb, bgr, iter, etc.)
- All From/Into conversions (layout reordering, type widening, gray-to-rgb, array, tuple)
- All operator impls (Add, Sub, Mul, Div, and Assign variants, Sum)
- All formatting (Display, UpperHex, LowerHex)
- Derive impls (Clone, Copy, Debug, Default, Eq, PartialOrd, Hash)
- Feature-gated: as-bytes, bytemuck, serde, checked_fns
- AsRef/AsMut impls
- Memory layout verification
With unstable-experimental, Gray becomes Gray_v09 and GrayAlpha becomes
GrayA. These named-struct types lack many trait impls that the v08 tuple
structs have (ComponentMap, ComponentSlice, ComponentBytes, AsRef, AsMut,
arithmetic ops, Sum, bytemuck Pod). Gate all affected tests so the suite
passes with --all-features.

252 tests without unstable-experimental, 206 with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant