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:
bors[bot] 2021-02-10 08:34:04 +00:00 committed by GitHub
commit c3e0b3e7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"]]);