asserts-rs

Crates.ioasserts-rs
lib.rsasserts-rs
version0.3.0
sourcesrc
created_at2022-04-24 08:39:22.452949
updated_at2022-04-25 02:51:48.962296
descriptionAsserts utilliy macros for Rust
homepagehttps://github.com/CGQAQ/asserts-rs
repositoryhttps://github.com/CGQAQ/asserts-rs
max_upload_size
id573014
size26,374
Jason (CGQAQ)

documentation

README

asserts-rs

Assert utillities

Utility macros

asserts_eq/assertsd_eq

use asserts_rs::*;
asserts_eq!(1, 1); //OK
asserts_eq!(1, 1, 1); // OK
asserts_eq!(1, 1, 1, 2); // panic 1 not equal to 2
assertsd_eq!(1, 1, 1, 2); // panic 1 not equal to 2(only in debug mode)

asserts_ne/assertsd_ne

use asserts_rs::*;
asserts_ne!(1, 2); //OK
asserts_ne!(1, 2, 3); // OK
asserts_ne!(1, 2, 1, 3); // panic 1 equal to 1
assertsd_ne!(1, 2, 1, 3); // panic 1 equal to 1(only in debug mode)

asserts_eq_one_of/assertsd_eq_one_of

use asserts_rs::*;
asserts_eq_one_of!(1, 1); //OK
asserts_eq_one_of!(1, 1, 2); // OK
asserts_eq_one_of!(1, 2, 3); // panic 1 is not equals to any of numbers in (2, 3)s
assertsd_eq_one_of!(1, 2, 3); // panic 1 is not equals to any of numbers in (2, 3)s(only in debug mode)

asserts_ne_one_of/assertsd_ne_one_of

use asserts_rs::*;
asserts_ne_one_of!(1, 2); //OK
asserts_ne_one_of!(1, 2, 3); // OK
asserts_ne_one_of!(1, 1, 1); // panic 1 is equals to all of numbers in (1, 1)
assertsd_ne_one_of!(1, 1, 1); // panic 1 is equals to all of numbers in (1, 1)(only in debug mode)
Commit count: 8

cargo fmt