Crate testutils

Crate testutils 

Source
Expand description

§Features

  • std Enables standard library support. When enabled, the crate cannot be used in no_std environments.

  • bool_ext

    • Adds .then_ok_or_else(||{err}) & .then_ok_or(err) method for bool type
  • print_ext

    • Provides some printing helpers.
  • re_exports_tap

    • pub use tap
  • os_cmd Configurable command builders:

    • Preconfigured cargo command structs (e.g., CargoDoc, CargoCmd)
    • Cross-platform command execution utilities

Re-exports§

pub use tap;re_exports_tap

Modules§

bool_extbool_ext
Extension trait for types that can be converted into a bool.
os_cmdos_cmd
print_extprint_ext

Macros§

dbgstd
Outputs the information of the expression(s) to stderr.
dbg_ref
Similar to the std::dbg! macro, but inspects values by reference without moving them. This allows debugging values without transferring ownership, while showing the underlying value’s type information (not reference types).
generate_struct_arr
Generates a list of tuples containing field names and their values
get_pkg_name
env!("CARGO_PKG_NAME")
ident_to_kebab_kv
Converts an identifier to a kebab-case key and its corresponding value.
ident_value_pair
Converts an identifier into a (name, value) pair.
new_once_lockstd
Generates a static OnceLock variable with the given name and type.

Functions§

simple_benchmarkstd
Runs the given function and prints the elapsed time. It supports stable Rust.