mock_todo

Crates.iomock_todo
lib.rsmock_todo
version0.1.0
created_at2025-06-15 15:30:05.876762+00
updated_at2025-06-15 15:30:05.876762+00
descriptionA macro that makes it easy to mock todo with values to make the code compilable.
homepagehttps://github.com/regpab/mock_todo
repositoryhttps://github.com/regpab/mock_todo
max_upload_size
id1713400
size15,751
(regpab)

documentation

README

A macro that makes it easy to mock todo with values to make the code compilable.

The macro has two features:

  • todo: works like a normal todo.
  • mock: returns the mock value we provide.

Installation

[dependencies]
mock_todo = { version = "0.1.0", features = ["mock"] }
# use the following commented line if you want to use a regular todo.
# mock_todo = { version = "0.1.0", features = ["todo"] }

Example of usage

use mock_todo::mock_todo;
// returns 0 if the feature is "mock" and panics with the message "not yet implemented: Add feature" otherwise.
fn feature() -> u32 {
    // first argument can be ommited.
    mock_todo!("Add feature", 0)
}
Commit count: 4

cargo fmt