[][src]Crate k9

see https://github.com/aaronabramov/k9 for high level description of the library

Modules

__macros__
assertions
config
string_diff

Macros

assert_equal

Asserts that two passed arguments are equal. panics if they are not

assert_err

Asserts if value is Err(T). panics if it is not

assert_err_matches_regex

Asserts that the passed Result argument is an Err and and the debug string of that error matches provided regex. Regular expressions are compiled using regex crate.

assert_greater_than

Asserts if left is greater than right. panics if they are not

assert_greater_than_or_equal

Asserts if left greater than or equal to right. panics if they are not

assert_lesser_than

Asserts if left is lesser than right. panics if they are not

assert_lesser_than_or_equal

Asserts if left lesser than or equal to right. panics if they are not

assert_matches_inline_snapshot
assert_matches_regex

Asserts that passed &str matches a regular expression. Regular expressions are compiled using regex crate.

assert_matches_snapshot

Formats passed value and asserts that it matches existing snaphot. If snapshot file for this test does not exist, test can be run with K9_UPDATE_SNAPSHOTS=1 environment variable to either create or replace existing snapshot file. Snapshots will be written into __k9_snapshots__ directory next to the test file.

assert_ok

Asserts if value is Ok(T). panics if it is not

Structs

Snap

String with concurrent access. Allows mutation without &mut reference to itself. It makes passing it to different parts of tests easier when performance is not important.