Skip to content

Commit 1966a67

Browse files
committed
rustdoc: Don't run Markdown tests twice
This matches the behaviour for finding tests in Rust files.
1 parent ccf401f commit 1966a67

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustdoc/markdown.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,12 @@ pub fn test(input: &str, cfgs: Vec<String>, libs: SearchPaths, externs: Externs,
163163
true, opts, maybe_sysroot, None,
164164
Some(input.to_owned()),
165165
render_type);
166-
old_find_testable_code(&input_str, &mut collector, DUMMY_SP);
167-
find_testable_code(&input_str, &mut collector, DUMMY_SP);
166+
if render_type == RenderType::Pulldown {
167+
old_find_testable_code(&input_str, &mut collector, DUMMY_SP);
168+
find_testable_code(&input_str, &mut collector, DUMMY_SP);
169+
} else {
170+
old_find_testable_code(&input_str, &mut collector, DUMMY_SP);
171+
}
168172
test_args.insert(0, "rustdoctest".to_string());
169173
testing::test_main(&test_args, collector.tests,
170174
testing::Options::new().display_output(display_warnings));

0 commit comments

Comments
 (0)