Skip to content

Commit

Permalink
docs and structure tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mishmish-dev committed Apr 1, 2023
1 parent ea3aa8b commit 8d3b51e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "subcase"
description = "Deduplicate unit test code in Rust without fixtures"
version = "0.2.0"
description = "Share parts of your test case intuitively"
version = "0.2.1"
edition = "2021"
rust-version = "1.56.1"
authors = ["Mishmish Dev <[email protected]>"]
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!-- cargo-rdme start -->

# Intuitive way to deduplicate your tests code
# Share parts of your test case intuitively

## What is a subcase?

Expand Down Expand Up @@ -46,7 +46,8 @@ with_subcases! {
with first `subcase!{{...}}` block, ignoring the second,
and vice versa.

That's not all! Subcases can be nested!
That's not all! Subcases can be nested! Replace the body
with this code:
```rust
let mut v = vec![1,2,3];
subcase! {{
Expand All @@ -72,11 +73,11 @@ subcase! {{
}}
assert_eq!(v.len(), 4);
```
In this example, test function body is executed 3 times: once
Test function body is executed 3 times: once
for each of leaf subcases (i.e. not containing more nested subcases),
while the big parent subcase is entered twice.

You can write only one subcase or no subcases at all --- function
You can write only one subcase or no subcases at all, function
will run as usual.

## Other oprions?
Expand Down
File renamed without changes.
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! # Intuitive way to deduplicate your tests code
//! # Share parts of your test case intuitively
//!
//! ## What is a subcase?
//!
Expand Down Expand Up @@ -40,7 +40,8 @@
//! with first `subcase!{{...}}` block, ignoring the second,
//! and vice versa.
//!
//! That's not all! Subcases can be nested!
//! That's not all! Subcases can be nested! Replace the body
//! with this code:
//! ```
//! # use subcase::with_subcases;
//! # with_subcases! {
Expand Down Expand Up @@ -72,11 +73,11 @@
//! # }
//! # }
//! ```
//! In this example, test function body is executed 3 times: once
//! Test function body is executed 3 times: once
//! for each of leaf subcases (i.e. not containing more nested subcases),
//! while the big parent subcase is entered twice.
//!
//! You can write only one subcase or no subcases at all --- function
//! You can write only one subcase or no subcases at all, function
//! will run as usual.
//!
//! ## Other oprions?
Expand Down

0 comments on commit 8d3b51e

Please sign in to comment.