MCPcopy Index your code
hub / github.com/assertables/assertables-rust-crate

github.com/assertables/assertables-rust-crate @10.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 10.1.0 ↗ · + Follow
1,967 symbols 2,481 edges 660 files 1 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Assertables: assert macros for better testing

Assertables is a Rust crate of assert macros to improve your compile-time tests and run-time reliability.

documentationcomparisonsllmsemailcodebergcrates.iogithubgitlab

Introduction

The Assertables Rust crate provides many assert macros that can help you develop, test, and debug.

This documentation is also available as llms.txt.

To use this crate, add it to your file Cargo.toml:

assertables = "10.1.0"

To enable all the assert macros everywhere in your code, add it to your src/lib.rs:

#[cfg(test)]
#[macro_use] extern crate assertables;

Benefits:

  • You can write better tests to improve reliability and maintainability.
  • You can handle more corner cases without needing to write custom code.
  • You can troubleshoot faster because error messages show more detail.

Learning: FAQ, docs, examples, changes, upgrades, developing.

Comparisons: more_asserts, cool_asserts, assert2, claims, etc.

Examples

Examples with numbers:

let i = 1;
assert_lt!(i, 2);
assert_in_range!(&i, 0..2);

Examples with strings:

let s = "hello";
assert_starts_with!(s, "h");
assert_is_match!(Regex::new(r"e.*o").unwrap(), s);

Examples with arrays:

let a = [1, 2, 3];
assert_contains!(a, &2);
assert_all!(a.iter(), |i: i32| i < 4);

Highlights

Values:

Floats:

Approximations:

Nearness:

Groups:

Matching:

Results:

Options:

Polls:

Readers:

Iterators:

Sets:

Bags:

Commands:

Status:

Infix values:

Infix logic:

For a complete list of modules and macros, see the docs.

Forms

All the macros have forms for an optional message:

All the macros have forms for different outcomes:

Many of the macros have a form "compare left item to right item" that compares items of the same kind, and a form "compare left item to right expression" that compares one item to any arbitrary expression:

Many of the macros has a "success return", which means the macro returns data that you can optionally use for more testing.

Tracking

  • Package: assertables-rust-crate
  • Version: 10.1.0
  • Created: 2021-03-30T15:47:49Z
  • Updated: 2026-06-01T07:30:16Z
  • License: MIT or A

Core symbols most depended-on inside this repo

onEachLazy
called by 32
doc/static.files/storage-118b08c4c78b968e.js
addClass
called by 28
doc/static.files/storage-118b08c4c78b968e.js
getSettingValue
called by 24
doc/static.files/storage-118b08c4c78b968e.js
hasClass
called by 24
doc/static.files/storage-118b08c4c78b968e.js
contains
called by 23
doc/static.files/search-a99f1315e7cc5121.js
removeClass
called by 21
doc/static.files/storage-118b08c4c78b968e.js
block
called by 16
doc/static.files/main-921df33f47b8780c.js
updateLocalStorage
called by 15
doc/static.files/storage-118b08c4c78b968e.js

Shape

Function 1,856
Method 68
Class 43

Languages

Rust91%
TypeScript9%

Modules by API surface

doc/static.files/search-a99f1315e7cc5121.js99 symbols
doc/static.files/main-921df33f47b8780c.js54 symbols
tests/examples/starters.rs39 symbols
doc/static.files/storage-118b08c4c78b968e.js15 symbols
src/assert_err/assert_err_ne_x.rs12 symbols
src/assert_email_address/assert_not_email_address.rs12 symbols
src/assert_some/assert_some_ne_x.rs11 symbols
src/assert_some/assert_some_ne.rs11 symbols
src/assert_ok/assert_ok_ne_x.rs11 symbols
src/assert_ok/assert_ok_ne.rs11 symbols
src/assert_f64/assert_f64_le.rs11 symbols
src/assert_f64/assert_f64_ge.rs11 symbols

For agents

$ claude mcp add assertables-rust-crate \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact