Crate test_utils[][src]

Expand description

Assorted testing utilities.

Most notable things are:

  • Rich text comparison, which outputs a diff.
  • Extracting markup (mainly, $0 markers) out of fixture strings.
  • marks (see the eponymous module).

Modules

Generates large snippets of Rust code for usage in the benchmarks.

Macros

Asserts that two strings are equal, otherwise displays a rich diff between them.

Structs

Enums

Constants

Functions

Inserts $0 marker into the text at offset.

Utility for writing benchmark tests.

Checks that the file has the specified contents. If that is not the case, updates the file and then fails the test.

Extracts //^^^ some text annotations.

Infallible version of try_extract_offset().

Infallible version of try_extract_range().

Extracts TextRange or TextSize depending on the amount of $0 markers found in text.

Extracts ranges, marked with <tag> </tag> pairs from the text

Returns the path to the root directory of rust-analyzer project.

Returns false if slow tests should not run, otherwise returns true and also creates a file at ./target/.slow_tests_cookie which serves as a flag that slow tests did run.

Checks that the file has the specified contents. If that is not the case, updates the file and return an Error.

Type Definitions

Type alias for a hashmap using the fx hash algorithm.