| Crates.io | renumber |
| lib.rs | renumber |
| version | 0.1.2 |
| created_at | 2025-02-13 20:45:51.177147+00 |
| updated_at | 2025-06-07 09:32:16.601992+00 |
| description | Renumber tests or benchmarks |
| homepage | |
| repository | https://github.com/EngosSoftware/renumber.git |
| max_upload_size | |
| id | 1554771 |
| size | 28,069 |
renumber is a simple command-line utility that renumbers Rust tests and benchmarks.
It is particularly useful when a single test or benchmark file contains multiple functions
that don't require meaningful names, such as in test-driven development (TDD).
renumber renames these functions sequentially as _0001, _0002, _0003, and so on.
$ cat ./tests/test_doc.rs
Output:
#[test]
fn _one_should_be_equal_to_one() {
assert_eq!(1, 1);
}
#[test]
fn _one_should_not_be_equal_to_two() {
assert_ne!(1, 2);
}
#[test]
fn _first_name_should_be_shorter_than_the_second() {
let first_name = "John";
let second_name = "Alexander";
assert!(first_name.cmp(&second_name).is_gt());
}
NOTE: Test names begin with underscore, otherwise renumber will skip it.
$ renumber ./tests/test_doc.rs
#[test]
fn _0001() {
assert_eq!(1, 1);
}
#[test]
fn _0002() {
assert_ne!(1, 2);
}
#[test]
fn _0003() {
let first_name = "John";
let second_name = "Alexander";
assert!(first_name.cmp(&second_name).is_gt());
}
#[test] or #[bench] and whose names begin with an underscore (_) are renamed.format!("_{:04}", index) (vote for #2 👍 to change it).Licensed under either of
Any contributions to renumber are greatly appreciated. All contributions intentionally submitted for inclusion in the work by you, shall be dual licensed as above, without any additional terms or conditions.
Brought to you with 💙 by Engos Software