Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Unit test runner with human-readable names for test functions
Kotlin supports function names with spaces and non-ASCII characters.
This functionality especially helps make unit test names more readable.
@Test
fun `a ≠ b`() {}
@Test
fun `Entities_contains() returns false when given entity is absent`() {}
(Fix: `Entities.contains()`
is not allowed. Changed to `Entities_contains()`
)
Unfortunately, such naming is not possible in Rust.
When I asked previously ( Can I set custom labels for test functions? ), I received advice on making test functions more readable by separating module names, but module names cannot contain spaces, and this method feels inconvenient.
Are there any unit test runners that allow us to give human-readable names or descriptions to test functions and display them during testing?
I'm looking for something that can extend unit testing functionality, similar to how criterion
extends benchmarking. For example, I'm imagining a tool that sets up unit tests using attributes like #[test(name = "my test name")]
or functions like test_runner.set_name("my test name").run();
.
1 post - 1 participant
🏷️ Rust_feed