Crate ra_ap_test_utils
source ·Expand description
Assorted testing utilities.
Most notable things are:
- Rich text comparison, which outputs a diff.
- Extracting markup (mainly, $0markers) 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$0marker into thetextatoffset.
- Utility for writing benchmark tests.
- Checks that thefilehas the specifiedcontents. If that is not the case, updates the file and then fails the test.
- Extracts//^^^ some textannotations.
- Infallible version oftry_extract_offset().
- Infallible version oftry_extract_range().
- ExtractsTextRangeorTextSizedepending on the amount of$0markers found intext.
- Extracts ranges, marked with<tag> </tag>pairs from thetext
- Returns the path to the root directory ofrust-analyzerproject.
- Returnsfalseif slow tests should not run, otherwise returnstrueand also creates a file at./target/.slow_tests_cookiewhich serves as a flag that slow tests did run.
- Checks that thefilehas the specifiedcontents. If that is not the case, updates the file and return an Error.
Type Aliases
- Type alias for a hashmap using thefxhash algorithm.