mirror of
https://github.com/rust-lang/cargo
synced 2024-10-14 03:32:39 +00:00
parent
9f265c885e
commit
a18b2e5078
|
@ -24,13 +24,13 @@ pub fn run_tests(manifest_path: &Path,
|
|||
|
||||
let libs = compile.package.targets().iter()
|
||||
.filter(|t| t.doctested())
|
||||
.map(|t| (t.src_path(), t.name()));
|
||||
.map(|t| (t.src_path(), t.name(), t.crate_name()));
|
||||
|
||||
for (lib, name) in libs {
|
||||
for (lib, name, crate_name) in libs {
|
||||
try!(config.shell().status("Doc-tests", name));
|
||||
let mut p = try!(compile.rustdoc_process(&compile.package));
|
||||
p.arg("--test").arg(lib)
|
||||
.arg("--crate-name").arg(name)
|
||||
.arg("--crate-name").arg(&crate_name)
|
||||
.arg("-L").arg(&compile.root_output)
|
||||
.arg("-L").arg(&compile.deps_output)
|
||||
.cwd(compile.package.root());
|
||||
|
|
|
@ -1400,3 +1400,22 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
|||
|
||||
", compiling = COMPILING, running = RUNNING, doctest = DOCTEST)))
|
||||
});
|
||||
|
||||
test!(dashes_to_underscores {
|
||||
let p = project("foo")
|
||||
.file("Cargo.toml", r#"
|
||||
[package]
|
||||
name = "foo-bar"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
"#)
|
||||
.file("src/lib.rs", r#"
|
||||
/// ```
|
||||
/// assert_eq!(foo_bar::foo(), 1);
|
||||
/// ```
|
||||
pub fn foo() -> i32 { 1 }
|
||||
"#);
|
||||
|
||||
assert_that(p.cargo_process("test"),
|
||||
execs().with_status(0));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue