cargo-extract-test 0.1.1

A Cargo subcommand to extract and run a single test function in isolation.
# cargo-extract-test

A Cargo subcommand to extract, compile and run a single test function in isolation.

## ๐Ÿš€ Purpose
cargo-extract-test allows you to:

Extract a specific test function from your project.

Compile and run it in isolation using cargo test --test.

Quickly debug or isolate failing tests without compiling and running the entire test suite.

## โš™๏ธ Installation
Option 1: Local Installation

## ๐Ÿงช Usage
To extract and run a specific test function:

```bash
cargo extract-test <test_function_name> [-- <cargo test args>]
```
For example:

```bash
cargo extract-test my_test_function -- --nocapture
```
This command:

Extracts my_test_function into a temporary test file.

Runs it using cargo test --test __temp_test, passing any additional arguments.

## ๐Ÿ”„ How It Works
The tool searches your project's source and test directories for the specified test function.

It copies the test function and any necessary use statements into a temporary file.

It compiles and runs the test in isolation, providing immediate feedback.

## ๐Ÿ“ฆ Dependencies
walkdir: For recursively searching directories.

## ๐Ÿงช Example
Given a test function:

```rust
#[cfg(test)]
mod tests {
    #[test]
    fn my_test_function() {
        assert_eq!(2 + 2, 4);
    }
}
```

## Running:
```bash
cargo extract-test my_test_function -- --nocapture
```

Will extract and run my_test_function in isolation.

## ๐Ÿ“„ License
This project is licensed under the MIT License.