#testing #output #capture #expected #actual

test-toolbox

This library provides useful macros for unit testing

5 releases (breaking)

Uses new Rust 2021

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

#359 in Testing

Download history 18/week @ 2022-08-03 19/week @ 2022-08-10 8/week @ 2022-08-17 13/week @ 2022-08-24 11/week @ 2022-08-31 21/week @ 2022-09-07 8/week @ 2022-09-14 8/week @ 2022-09-21 16/week @ 2022-09-28 19/week @ 2022-10-05 6/week @ 2022-10-12 5/week @ 2022-10-19 14/week @ 2022-10-26 17/week @ 2022-11-02 14/week @ 2022-11-09 17/week @ 2022-11-16

62 downloads per month
Used in 2 crates

MIT license

22KB
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

~170KB