Crate testutils

Source
Expand description

§Features

  • all All available features enabled

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

  • ext_traits Additional trait extensions:

    • BoolExt - Adds .ok_or_else() method for bool type
    • Re-exports Pipe and Tap traits from tap crate
  • tiny_container Compact string (<=N: Inline(Stack), >N: Overflow to Heap):

    • TString<const N: usize> type alias for TinyString<[u8; N]>
    • Formattable trait
      • Enables format support for TString
    • IntoBoxedStr trait
      • Adds .into_boxed_str() conversion
  • os_cmd Configurable command builders:

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

Modules§

os_cmdos_cmd
tiny_containertiny_container
TString & TinyVec
traitsext_traits
Provides BoolExt(.ok_or_else())

Macros§

dbgstd
Outputs the information of the expression(s) to stderr.
dbg_ref
Similar to the 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_kvos_cmd
Converts an identifier to a kebab-case key and its corresponding value.
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.