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§
- bench_fixture 
- Generates large snippets of Rust code for usage in the benchmarks.
Macros§
- assert_eq_ text 
- Asserts that two strings are equal, otherwise displays a rich diff between them.
Structs§
Enums§
Constants§
Functions§
- __diff
- add_cursor 
- Inserts $0marker into thetextatoffset.
- bench
- Utility for writing benchmark tests.
- ensure_file_ contents 
- Checks that the filehas the specifiedcontents. If that is not the case, updates the file and then fails the test.
- extract_annotations 
- Extracts //^^^ some textannotations.
- extract_offset 
- Infallible version of try_extract_offset().
- extract_range 
- Infallible version of try_extract_range().
- extract_range_ or_ offset 
- Extracts TextRangeorTextSizedepending on the amount of$0markers found intext.
- extract_tags 
- Extracts ranges, marked with <tag> </tag>pairs from thetext
- format_diff 
- project_root 
- Returns the path to the root directory of rust-analyzerproject.
- skip_slow_ tests 
- Returns falseif 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.
- target_dir 
- try_ensure_ file_ contents 
- Checks that the filehas the specifiedcontents. If that is not the case, updates the file and return an Error.
Type Aliases§
- FxHashMap 
- Type alias for a hash map that uses the Fx hashing algorithm.