https://github.com/ararog/caramelo
Idiomatic unit test framework for rust
https://github.com/ararog/caramelo
assertions rust testing testing-framework unit-testing
Last synced: about 11 hours ago
JSON representation
Idiomatic unit test framework for rust
- Host: GitHub
- URL: https://github.com/ararog/caramelo
- Owner: ararog
- License: apache-2.0
- Created: 2026-04-19T21:24:00.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-06-17T21:12:54.000Z (7 days ago)
- Last Synced: 2026-06-17T23:12:45.330Z (7 days ago)
- Topics: assertions, rust, testing, testing-framework, unit-testing
- Language: Rust
- Homepage: https://ararog.github.io/caramelo/
- Size: 162 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# caramelo
[](https://crates.io/crates/caramelo) [](https://crates.io/crates/caramelo) [](https://github.com/ararog/caramelo/actions/workflows/rust.yml)  [](https://docs.rs/caramelo/latest/caramelo) [](https://github.com/ararog/caramelo/blob/main/LICENSE.md) [](https://codecov.io/gh/ararog/caramelo)
**Caramelo** (caramel in Portuguese, named after popular brazilian dog) is a comprehensive, production-ready unit testing framework for Rust with a focus on simplicity and ease of use.
## Features
Several useful matchers:
- relational: eq, ne, le, lt, ge and gt
- logical: and, or
- range: 1..2 or 1.. or ..2 and its variants
- array: item, len, \_in_
- wildcard: any
- string: contains, starts-with, ends-with
- http: method, path, header, header_value, body
- json: exact_json_body, partial_json_body
- xml: exact_xml_body, partial_xml_body
- others: custom
## Quick Start
Add caramelo to your `Cargo.toml`:
```toml
caramelo = { version = "0.1.0" }
```
## Usage Example
Here's how simple it is to create unit tests with caramelo:
```rust
use caramelo::{expect, matchers::eq, assertions::Is};
/// Test equality matcher
#[test]
fn test_equal() {
expect(1).to_be(eq(1));
}
#[test]
#[should_panic(expected = "Expected 1 to be equals to 2")]
fn test_not_equal() {
expect(1).to_be(eq(2));
}
```
## Subprojects
### [caramelo](https://github.com/ararog/caramelo)
Base crate for caramelo.
### [caramelo-macros](https://github.com/ararog/caramelo/tree/develop/caramelo-macros)
A crate with collection of convenience macros for caramelo.
## License
Licensed under either of
- Apache License, Version 2.0
(LICENSE-APACHE or )
- MIT license
(LICENSE-MIT or )
at your option.
## Author
Rogerio Pereira Araujo