Skip to the content.

Caramelo

Crates.io downloads crates.io Build Status Crates.io MSRV Documentation MIT licensed codecov

Caramelo (caramel in Portuguese) is a comprehensive, production-ready unit testing framework for Rust with a focus on simplicity and ease of use.

Quick Start

Add to your Cargo.toml:

[dependencies]
caramelo = { version = "0.1.0" }

Basic usage:

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));
}

/// Test is assertion

#[test]
fn test_is() {
    "a".is("a");
}

#[test]
#[should_panic(expected = "Expected a to be equal to b")]
fn test_is_panic() {
    "a".is("b");
}

Crates

Crate Description Documentation
caramelo Core testing framework docs.rs
caramelo-macros Convenience macros docs.rs

Examples

Check out the examples for complete examples of how to use Caramelo in your projects.

Documentation

License

This project is licensed under the MIT License.

Author

Rogerio Pereira Araujo rogerio.araujo@gmail.com