parasyte / parasyte/pixels

Fix `pixels-mocks` crate

Open
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation
Dominant language
Rust
Stars
2.1k
Forks
147
Avg merge
12m
Merged PRs (30d)
1

Description

We have cargo doctests enabled in CI, but many of them do not run because they are tagged with no_run. The reason for this is the pixels-mocks crate doesn't generate valid code (it just compiles).

This has resulted in at least one bad example that would have hit an assertion failure: https://github.com/parasyte/pixels/blob/de21862c7740623cdaa9c0836b25295976151710/src/lib.rs#L352-L367

The last assertion should compare against (11, 239)

Fixing the pixels-mocks crate enough that the examples can run would have prevented this error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the pixels-mocks crate and reviewing the cargo doctest configuration in CI. Inspect the example around src/lib.rs lines 352-367, then make the mocks generate runnable code rather than only compiling. Done means the relevant doctests run without no_run and expose the expected assertion result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.