Skip to content

is and it modifiers have to be first class citizens #75

@luke-biel

Description

@luke-biel

Existence of hamcrest_assertions is usefull, but requires addition of an extra crate. It would be beneficial if user could write test_case(args => is ...) without extra work.

For first release, for all assertions provided by hamcrest2 lib we should either cover it with our own syntax or mention replacement/why it's not implemented.

Later we'll be able to expand functionality of is|it on our own.

General matchers

  • eq - already covered via arg => value is equal_to X
  • not eq
  • (not) lt is less_than X
  • (not) leq is less_or_equal_than X
  • (not) gt is greater_than X
  • (not) geq is greater_or_equal_than X
  • (not) type_of - do we need that?
  • Add it (not) matches_regex ... #80

Numerical matchers

  • (not) close_to is almost_equal_to X

Filesystem matchers

  • (not) path_exists is existing_path
  • (not) file_exists is file
  • (not) dir_exists is dir

Option and Result

  • has - matches Ok(5) can be used
  • negated has - matches Ok(v) if v != 5
  • (not) ok - matches Ok(_) & matches Err(_)
  • (not) err - same
  • (not) some - same
  • (not) none - same

Collection matchers

Compound matchers

  • (not) all
  • (not) any

Misc

  • is(bool) - supported via arg => value
  • anything - useless in test_case context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions