Crate test_tools

source ·
Expand description

§Module :: test_tools

experimental rust-status docs.rs Open in Gitpod discord

Tools for writing and running tests.

§Basic use-case

use test_tools::*;

#[ cfg( feature = "enabled" ) ]
#[ cfg( not( feature = "no_std" ) ) ]
tests_impls!
{
  fn pass1()
  {
    assert_eq!( true, true );
  }

  //

  fn pass2()
  {
    assert_eq!( 1, 1 );
  }
}

//
#[ cfg( feature = "enabled" ) ]
#[ cfg( not( feature = "no_std" ) ) ]
tests_index!
{
  pass1,
  pass2,
}

§To add to your project

cargo add test_tools --dev

§Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/test_trivial
cargo run

§Sample

discord Open in Gitpod docs.rs

Modules§

Macros§

  • Internal impls1 macro. Don’t use.
  • 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.
  • Literally just a BTreeMap literal with keys and values into’d.
  • Unwrap braces of token tree and pass its content to the passed callback. If token tree in not braced then it passed to callback as is.
  • Literally just a BTreeSet literal with values into’d.
  • 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.
  • Test a file with documentation.
  • Get name of a function.
  • Macro to rename function.
  • Split functions.
  • Split functions.
  • Literally just a BinaryHeap literal with values into’d.
  • Literally just a HashMap literal with keys and values into’d.
  • Literally just a HashSet literal with values into’d.
  • Macro which returns its input as is.
  • Macro implements to answer the question: does it implement a trait?
  • Macros to put each function under a named macro to index every function in a class.
  • Define implementation putting each function under a macro.
  • Define implementation putting each function under a macro.
  • Macros to put each function under a named macro to index every function in a class.
  • Define implementation putting each function under a macro.
  • Index of items.
  • Macro to inspect type of a variable and its size exporting it as a string.
  • Macro to inspect type of a variable and its size printing into stdout and exporting it as a string.
  • Macro instance_of to answer the question: does it implement a trait? Alias of the macro implements.
  • Macro to answer the question: is it a slice?
  • Literally just a LinkedList literal with values into’d.
  • Protocol of modularity unifying interface of a module and introducing layers.
  • Required to convert integets to floats.
  • Define implementation putting each function under a macro and adding attribute #[ test ].
  • Define implementation putting each function under a macro and adding attribute #[ test ].
  • Index of items.
  • Literally just a VecDeque literal with values into’d.

Structs§

Enums§

  • The enum Either with variants Left and Right is a general purpose sum type with two cases.

Functions§

Attribute Macros§