Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: doc-test failures #12055

Merged
merged 3 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/cargo-test-support/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ use std::path::{Path, PathBuf};

/// Used by `cargo install` tests to assert an executable binary
/// has been installed. Example usage:
/// ```no_run
/// use cargo_test_support::install::assert_has_installed_exe;
/// use cargo_test_support::install::cargo_home;
///
/// assert_has_installed_exe(cargo_home(), "foo");
/// assert_has_installed_exe(cargo_home(), "foo");
/// ```
#[track_caller]
pub fn assert_has_installed_exe<P: AsRef<Path>>(path: P, name: &'static str) {
assert!(check_has_installed_exe(path, name));
Expand Down
6 changes: 4 additions & 2 deletions crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,15 @@ impl Execs {
/// The substrings are matched as `contains`. Example:
///
/// ```no_run
/// execs.with_stderr_line_without(
/// use cargo_test_support::execs;
///
/// execs().with_stderr_line_without(
/// &[
/// "[RUNNING] `rustc --crate-name build_script_build",
/// "-C opt-level=3",
/// ],
/// &["-C debuginfo", "-C incremental"],
/// )
/// );
/// ```
///
/// This will check that a build line includes `-C opt-level=3` but does
Expand Down
13 changes: 8 additions & 5 deletions crates/cargo-test-support/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,10 @@ impl RegistryBuilder {
/// `VendorPackage` which implements directory sources.
///
/// # Example
/// ```
/// ```no_run
/// use cargo_test_support::registry::Package;
/// use cargo_test_support::project;
///
/// // Publish package "a" depending on "b".
/// Package::new("a", "1.0.0")
/// .dep("b", "1.0.0")
Expand Down Expand Up @@ -1240,7 +1243,7 @@ impl Package {
}

/// Adds a normal dependency. Example:
/// ```
/// ```toml
/// [dependencies]
/// foo = {version = "1.0"}
/// ```
Expand All @@ -1249,7 +1252,7 @@ impl Package {
}

/// Adds a dependency with the given feature. Example:
/// ```
/// ```toml
/// [dependencies]
/// foo = {version = "1.0", "features": ["feat1", "feat2"]}
/// ```
Expand All @@ -1272,7 +1275,7 @@ impl Package {
}

/// Adds a dev-dependency. Example:
/// ```
/// ```toml
/// [dev-dependencies]
/// foo = {version = "1.0"}
/// ```
Expand All @@ -1281,7 +1284,7 @@ impl Package {
}

/// Adds a build-dependency. Example:
/// ```
/// ```toml
/// [build-dependencies]
/// foo = {version = "1.0"}
/// ```
Expand Down
2 changes: 1 addition & 1 deletion crates/crates-io/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl Registry {
/// let mut handle = Easy::new();
/// // If connecting to crates.io, a user-agent is required.
/// handle.useragent("my_crawler (example.com/info)");
/// let mut reg = Registry::new_handle(String::from("https://crates.io"), None, handle);
/// let mut reg = Registry::new_handle(String::from("https://crates.io"), None, handle, true);
/// ```
pub fn new_handle(
host: String,
Expand Down