logo
Expand description

Tools for writing and running tests.

Module :: test_tools

experimental rust-status docs.rs Open in Gitpod discord

Tools for writing and running tests.

Sample

use test_tools::*;

tests_impls!
{
  fn pass1()
  {
    assert_eq!( true, true );
  }

  //

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

//

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 sample/rust/test_trivial
cargo run

Modules

Tools for writing and running tests.

Basics.

Dependencies.

Exposed namespace of the module.

Helpers.

Prelude to use essentials: use my_module::prelude::*.

Macros

Asserts that two expressions are identical to each other.

Asserts that two expressions are not identical to each other.

Asserts that a boolean expression is true at runtime.

Asserts that two expressions are equal to each other (using PartialEq).

Asserts that two expressions are not equal to each other (using PartialEq).

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.

Macro implements to answer the question: does it implement a trait?

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.

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.