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§
- 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
$0
marker into thetext
atoffset
. - bench
- Utility for writing benchmark tests.
- ensure_
file_ contents - Checks that the
file
has the specifiedcontents
. If that is not the case, updates the file and then fails the test. - extract_
annotations - Extracts
//^^^ some text
annotations. - extract_
offset - Infallible version of
try_extract_offset()
. - extract_
range - Infallible version of
try_extract_range()
. - extract_
range_ or_ offset - Extracts
TextRange
orTextSize
depending on the amount of$0
markers 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-analyzer
project. - skip_
slow_ tests - Returns
false
if slow tests should not run, otherwise returnstrue
and also creates a file at./target/.slow_tests_cookie
which serves as a flag that slow tests did run. - target_
dir - try_
ensure_ file_ contents - Checks that the
file
has the specifiedcontents
. If that is not the case, updates the file and return an Error.
Type Aliases§
- FxHash
Map - Type alias for a hash map that uses the Fx hashing algorithm.