Merge #7621
7621: Use track caller in test documentation r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
c3e0b3e7b7
@ -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 New Issue
Block a user