mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Use track caller in test documentation
This commit is contained in:
parent
36465b34b3
commit
d932812134
1 changed files with 1 additions and 1 deletions
|
@ -372,11 +372,11 @@ Tests which directly call various API functions are a liability, because they ma
|
|||
So most of the tests look like this:
|
||||
|
||||
```rust
|
||||
#[track_caller]
|
||||
fn check(input: &str, expect: expect_test::Expect) {
|
||||
// The single place that actually exercises a particular API
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn foo() {
|
||||
check("foo", expect![["bar"]]);
|
||||
|
|
Loading…
Reference in a new issue