@@ -18,7 +18,8 @@ doctests, it is hard to identify which doctest is which in the test runner
18
18
output by line number alone.
19
19
20
20
By giving users the option to give names to doctests, identifying individual
21
- doctests in test runner output will be easier.
21
+ doctests in test runner output will be easier. Additionally, users could re-run
22
+ specific tests using ` cargo test --doc -- $TEST_NAME ` .
22
23
23
24
# Guide-level explanation
24
25
[ guide-level-explanation ] : #guide-level-explanation
@@ -53,7 +54,6 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
53
54
If you'd like to have the test runner print a more informative name, perhaps
54
55
because there are many doctests in a single file, you can put ` name=NAME ` ,
55
56
where ` NAME ` is the name the test should have, in the doctest's info string.
56
- ` NAME ` should be a valid Rust identifer.
57
57
58
58
59
59
```` rust
@@ -77,18 +77,18 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
77
77
[ reference-level-explanation ] : #reference-level-explanation
78
78
79
79
The set of valid words that may appear in code block info strings is extended
80
- to include patterns of the form ` name=IDENT ` .
80
+ to include patterns of the form ` name=NAME ` .
81
81
82
- This ` IDENT ` will be the name of the documentation test generated by the code
82
+ This ` NAME ` will be the name of the documentation test generated by the code
83
83
block.
84
84
85
85
When the test runner runs the documentation test, the test will be identified
86
86
by this name, in addition to the test binary, module, and line number.
87
87
88
- Multiple ` name=IDENT ` words may not appear in a single code block's info
88
+ Multiple ` name=NAME ` words may not appear in a single code block's info
89
89
string.
90
90
91
- ` name=IDENT ` may be combined with existing annotations like ` rust ` or
91
+ ` name=NAME ` may be combined with existing annotations like ` rust ` or
92
92
` should_panic ` by separating the annotations with commas:
93
93
94
94
````
@@ -129,7 +129,8 @@ little hard to make sense of.
129
129
# Prior art
130
130
[ prior-art ] : #prior-art
131
131
132
- None.
132
+ Unit and integration tests have names. This change would bring doctests closer
133
+ to parity, by allowing features like test filtering to work with doctests.
133
134
134
135
# Unresolved questions
135
136
[ unresolved-questions ] : #unresolved-questions
0 commit comments