Use track caller in test documentation

This commit is contained in:
Aleksey Kladov 2021-02-10 11:26:48 +03:00
parent 36465b34b3
commit d932812134

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