logo
Expand description

Tools for writing and running tests.

Module :: wtest_basic

experimental rust-status docs.rs Open in Gitpod discord

Tools for writing and running tests. The most basic things.

Sample

use wtest_basic::*;

//

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 wtest_basic --dev

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/test_basic_trivial
cargo run

Re-exports

pub use ::paste;
pub use ::trybuild;
pub use ::anyhow;
pub use ::rustversion;
pub use ::meta_tools;
pub use ::mem_tools;
pub use ::typing_tools;
pub use ::num_traits;

Modules

Basics.

Dependencies.

Diagnostics tools.

Collection of primal data types.

Exposed namespace of the module.

Utilities for formatting and printing strings.

Collection of tools to manipulate memory.

Collection of general purpose meta tools.

Orphan namespace of the module.

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

Protected namespace of the module.

Collection of general purpose tools for type checking.

Macros

Generate code only if feature::make is enabled.

Type constructor of many.

Pair type constructor.

Type constructor of single.

Alias of Vec for internal usage.

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.

Test a file with documentation.

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.

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?

Variadic constructor.

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.

Type constructor to define tuple wrapping a given type.

Structs

An ordered map based on a B-Tree.

An ordered set based on a B-Tree.

A priority queue implemented with a binary heap.

A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Iterator for enumerable.

Iterator for enumerable.

A hash map implemented with quadratic probing and SIMD lookup.

A hash set implemented as a HashMap where the value is ().

Type constructor to wrap pair of the same type.

Alternative implementation of interval.

A doubly-linked list with owned nodes.

Type constructor to wrap a vector.

A hash map implemented with quadratic probing and SIMD lookup.

Type constructor to wrap two types into a tuple.

A hash set implemented as a HashMap where the value is ().

Type constructor to wrap a another type into a tuple.

A contiguous growable array type, written as Vec<T>, short for ‘vector’.

A double-ended queue implemented with a growable ring buffer.

A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums

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

Traits

Reinterpret as array.

Reinterpret as slice.

Reinterpret as tuple.

Clone as array.

Clone as tuple.

Has length and indexed access.

Interval adapter. Interface to interval-like structures.

Constructor without arguments.

Constructor with single argument.

Constructor with two arguments.

Constructor with three arguments.

Implementation of trait From to vectorize into/from.

Implementation of trait Into to vectorize into/from.