#unit-testing #capture #output #debugging #actual #expected

test-toolbox

This library provides useful macros for unit testing

5 releases (breaking)

0.5.0 Nov 3, 2021
0.4.0 Oct 30, 2021
0.3.0 Oct 29, 2021
0.2.0 Oct 25, 2021
0.1.0 Aug 21, 2021

#421 in Testing

36 downloads per month
Used in 2 crates

MIT license

23KB
400 lines

test-toolbox

Utility library of helper macros for working with unit tests.

Macros

  • actual! - declare actual variable with differing debug and release syntax
  • expect! - declare expected variable with differing debug and release values
  • capture! - captures stdout and stderr for testing output

Resources

  • Docs for more detailed information

Usage

Each macro is gated by a feature.

No feature is mutually exclusive and can be combined as needed.

  • actual! macro
[dependencies]

test-toolbox = { version = "0.5", features = ["actual"] }
  • capture! macro
[dependencies]

test-toolbox = { version = "0.5", features = ["capture"] }
  • expect! macro
[dependencies]

test-toolbox = { version = "0.5", features = ["expect"] }

Implemented

  • actual! macro
  • expect macro
  • capture! macro

lib.rs:

Utility library of helper macros for working with unit tests.

Macros

  • actual! - declare actual variable with differing debug and release syntax
  • expect! - declare expected variable with differing debug and release values
  • capture! - captures stdout and stderr for testing output

Dependencies

~0–9MB
~79K SLoC