Expand description
Tools for writing and running tests.
§Module :: wtest_basic
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;
pub use ::diagnostics_tools;
Modules§
- basic
- Basics.
- dependency
- Dependencies.
- diagnostics
- Diagnostics tools.
- dt
- Collection of primal data types.
- exposed
- Exposed namespace of the module.
- fmt
- Utilities for formatting and printing strings.
- mem
- Collection of tools to manipulate memory.
- meta
- Collection of general purpose meta tools.
- orphan
- Orphan namespace of the module.
- prelude
- Prelude to use essentials:
use my_module::prelude::*
. - protected
- Protected namespace of the module.
- typing
- Collection of general purpose tools for type checking.
Macros§
- _if_
make - Generate code only if feature::make is enabled.
- _many
- Type constructor of many.
- _pair
- Pair type constructor.
- _single
- Type constructor of single.
- _vec
- Alias of Vec for internal usage.
- a_
dbg_ id - Asserts that two expressions are identical to each other.
- a_
dbg_ not_ id - Asserts that two expressions are not identical to each other.
- a_
dbg_ true - Asserts that a boolean expression is true at runtime.
- a_id
- Asserts that two expressions are equal to each other (using
PartialEq
). - a_
not_ id - Asserts that two expressions are not equal to each other (using
PartialEq
). - a_true
- Asserts that a boolean expression is true at runtime.
- cta_
mem_ same_ size - Compile-time assertion that two values have the same size.
- cta_
ptr_ same_ size - Compile-time assertion that memory behind two references have the same size.
- cta_
true - Macro to compare meta condition is true at compile-time.
- cta_
type_ same_ align - Compile-time assertion of having the same align.
- cta_
type_ same_ size - Compile-time assertion that two types have the same size.
- doc_
file_ test - Test a file with documentation.
- implements
- Macro
implements
to answer the question: does it implement a trait? - impls
- Define implementation putting each function under a macro.
- index
- Index of items.
- inspect_
to_ str_ type_ of - Macro to inspect type of a variable and its size exporting it as a string.
- inspect_
type_ of - Macro to inspect type of a variable and its size printing into stdout and exporting it as a string.
- instance_
of - Macro
instance_of
to answer the question: does it implement a trait? Alias of the macroimplements
. - is_
slice - Macro to answer the question: is it a slice?
- make
- Variadic constructor.
- num
- Required to convert integets to floats.
- tests_
impls - Define implementation putting each function under a macro and adding attribute
#[ test ]
. - tests_
impls_ optional - Define implementation putting each function under a macro and adding attribute
#[ test ]
. - tests_
index - Index of items.
- types
- Type constructor to define tuple wrapping a given type.
Structs§
- BTree
Map - An ordered map based on a B-Tree.
- BTree
Set - An ordered set based on a B-Tree.
- Binary
Heap - A priority queue implemented with a binary heap.
- DynArray
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’. - Enumerable
Iterator Consumable - Iterator for enumerable.
- Enumerable
Iterator NonConsumable - Iterator for enumerable.
- HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- HashSet
- A hash set implemented as a
HashMap
where the value is()
. - Homo
Pair - Type constructor to wrap pair of the same type.
- Interval
- Alternative implementation of interval.
- Linked
List - A doubly-linked list with owned nodes.
- Many
- Type constructor to wrap a vector.
- Map
- A hash map implemented with quadratic probing and SIMD lookup.
- Pair
- Type constructor to wrap two types into a tuple.
- Set
- A hash set implemented as a
HashMap
where the value is()
. - Single
- Type constructor to wrap a another type into a tuple.
- Vec
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’. - VecDeque
- A double-ended queue implemented with a growable ring buffer.
- _Vec
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’.
Enums§
- Either
- The enum
Either
with variantsLeft
andRight
is a general purpose sum type with two cases.
Traits§
- AsArray
- Reinterpret as array.
- AsSlice
- Reinterpret as slice.
- AsTuple
- Reinterpret as tuple.
- Clone
AsArray - Clone as array.
- Clone
AsTuple - Clone as tuple.
- Enumerable
- Has length and indexed access.
- Interval
Adapter - Interval adapter. Interface to interval-like structures.
- Make0
- Constructor without arguments.
- Make1
- Constructor with single argument.
- Make2
- Constructor with two arguments.
- Make3
- Constructor with three arguments.
- Vectorized
From - Implementation of trait From to vectorize into/from.
- Vectorized
Into - Implementation of trait Into to vectorize into/from.