Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitsuhiko/similar-asserts
Provides assert_eq! like macros with colorized diff output
https://github.com/mitsuhiko/similar-asserts
Last synced: 6 days ago
JSON representation
Provides assert_eq! like macros with colorized diff output
- Host: GitHub
- URL: https://github.com/mitsuhiko/similar-asserts
- Owner: mitsuhiko
- License: apache-2.0
- Created: 2021-02-25T22:36:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T21:38:08.000Z (4 months ago)
- Last Synced: 2024-12-20T18:06:13.238Z (13 days ago)
- Language: Rust
- Size: 148 KB
- Stars: 137
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# similar-asserts
[![Build Status](https://github.com/mitsuhiko/similar-asserts/workflows/Tests/badge.svg?branch=main)](https://github.com/mitsuhiko/similar-asserts/actions?query=workflow%3ATests)
[![Crates.io](https://img.shields.io/crates/d/similar-asserts.svg)](https://crates.io/crates/similar-asserts)
[![License](https://img.shields.io/github/license/mitsuhiko/similar-asserts)](https://github.com/mitsuhiko/similar-asserts/blob/main/LICENSE)
[![Documentation](https://docs.rs/similar-asserts/badge.svg)](https://docs.rs/similar-asserts)`similar-asserts` is a crate that enhances the default assertion experience
by using [similar](https://crates.io/crates/similar) for diffing. It supports
comparing either `Debug` or `Serialize` representations of values. On failed
assertions it renders out a colorized diff to the terminal.```rust
fn main() {
let reference = vec![1, 2, 3, 4];
similar_asserts::assert_eq!(reference, (0..4).collect::>());
}
```![](https://raw.githubusercontent.com/mitsuhiko/similar-asserts/main/assets/screenshot.png)
## Related Projects
* [insta](https://insta.rs) snapshot testing library
* [similar](https://insta.rs/similar) diffing library## License and Links
- [Documentation](https://docs.rs/similar-asserts/)
- [Issue Tracker](https://github.com/mitsuhiko/similar-asserts/issues)
- [Examples](https://github.com/mitsuhiko/similar-asserts/tree/main/examples)
- License: [Apache-2.0](https://github.com/mitsuhiko/similar-asserts/blob/main/LICENSE)