File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ impl DocTestRunner {
4545 self . crate_attrs . insert ( line. to_string ( ) ) ;
4646 }
4747 }
48- // if !self.ids.is_empty() {
49- // self.ids.push(',');
50- // }
48+ if !self . ids . is_empty ( ) {
49+ self . ids . push ( ',' ) ;
50+ }
5151 self . ids . push_str ( & format ! (
52- "tests.push( {}::TEST); \n " ,
52+ "{}::TEST" ,
5353 generate_mergeable_doctest(
5454 doctest,
5555 scraped_test,
@@ -107,14 +107,14 @@ impl DocTestRunner {
107107#[rustc_main]
108108#[coverage(off)]
109109fn main() {{
110- let mut tests = Vec::new();
111- {ids}
110+ const TESTS: [test::TestDescAndFn; {nb_tests}] = [{ids}];
112111test::test_main(
113112 &[{test_args}],
114- tests ,
113+ Vec::from(TESTS) ,
115114 None,
116115);
117116}}" ,
117+ nb_tests = self . nb_tests,
118118 output = self . output,
119119 ids = self . ids,
120120 )
@@ -192,7 +192,7 @@ pub const TEST: test::TestDescAndFn = test::TestDescAndFn {{
192192 compile_fail: false,
193193 no_run: {no_run},
194194 should_panic: test::ShouldPanic::{should_panic},
195- test_type: test::TestType::UnitTest ,
195+ test_type: test::TestType::DocTest ,
196196 }},
197197 testfn: test::StaticTestFn(
198198 #[coverage(off)]
You can’t perform that action at this time.
0 commit comments