Crate diagnostics_tools
source ·Expand description
§Module :: diagnostics_tools
Diagnostics tools.
§Basic use-case
#[ test ]
#[ should_panic ]
fn a_id_panic_test()
{
a_id!( 1, 2 );
/*
print :
...
thread 'a_id_panic_test' panicked at 'assertion failed: `(left == right)`
Diff < left / right > :
<1
>2
...
*/
}
§To add to your project
cargo add diagnostics_tools
§Try out from the repository
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/diagnostics_tools_trivial
cargo run
Modules§
- Dependencies.
- Compile-time asserting.
- Exposed namespace of the module.
- Orphan namespace of the module.
- Prelude to use essentials:
use my_module::prelude::*
. - Protected namespace of the module.
Macros§
- Asserts that a boolean expression is false at runtime.
- Asserts that two expressions are identical.
- Asserts that two expressions are not identical with each other.
- Asserts that a boolean expression is true at runtime.
- Asserts that a boolean expression is false at runtime.
- Asserts that two expressions are identical to each other (using
PartialEq
). Prints nice diff. - Asserts that two expressions are not identical to each other (using
PartialEq
). Prints nice diff. - Asserts that a boolean expression is true at runtime.
- Compile-time assertion that two values have the same size.
- Compile-time assertion that memory behind two references have the same size.
- Macro to compare meta condition is true at compile-time.
- Compile-time assertion of having the same align.
- Compile-time assertion that two types have the same size.