Module test

Source
Expand description

Test utilities

A collection of testing utilities and helpers:

  • assert: Custom assertions for comparing directory structures, iterables, JSON strings and more
  • builder: Test data builders and fixtures
  • crypto_helper: Cryptographic utilities for testing
  • double: Test doubles (mocks, fakes, dummies, …)
  • entities_extensions: Extension traits adding test-specific methods for crate::entities
  • logging: Test logging infrastructure
  • mock_extensions: Additional mocking utilities
  • temp_dir: Temporary directory management for tests

Modules§

builder
Builders for test
crypto_helper
Test utilities for Mithril STM types
double
Test doubles
entities_extensions
A set of extension traits to add test utilities to this crate entities
logging
Logging utilities for tests
mock_extensions
A set of tools for working with automock

Macros§

assert_dir_eq
Compare a directory against a string representing its expected structure or against another directory.
assert_equivalent
Assert that two iterators are equivalent
assert_same_json
Compare two json strings ignoring keys order
current_function
Returns the name of the function that called this macro.
current_function_path
Returns the path of the function that called this macro.
temp_dir
Return a temporary directory based on the current function name.
temp_dir_create
Create and return a temporary directory based on the current function name.

Structs§

DirStructure
A structure to compare two directories in a human-readable way in tests.
TempDir
A builder of temp directory for tests purpose.

Functions§

as_sorted_vec
Create a sorted clone of an iterable.
equivalent_to
Compare two iterators ignoring the order
format_current_function_module
Return the path of the given function. If the last function is f, it is removed. The last {{closure}} is also removed.
format_current_function_path
Return a string representing the path of the given function.