Added the no_run attribute

This commit is contained in:
QiangHeisenberg 2023-05-04 16:20:31 +08:00
parent ea0d487b99
commit ff7ff7d50d
2 changed files with 32 additions and 33 deletions

View File

@ -4,11 +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");
/// ```
#[track_caller]
pub fn assert_has_installed_exe<P: AsRef<Path>>(path: P, name: &'static str) {
assert!(check_has_installed_exe(path, name));

View File

@ -450,11 +450,10 @@ impl RegistryBuilder {
/// `VendorPackage` which implements directory sources.
///
/// # Example
/// ```
/// ```no_run
/// use cargo_test_support::registry::Package;
/// use cargo_test_support::project;
///
/// fn crate_package_test() {
/// // Publish package "a" depending on "b".
/// Package::new("a", "1.0.0")
/// .dep("b", "1.0.0")
@ -488,7 +487,6 @@ impl RegistryBuilder {
/// .build();
///
/// p.cargo("run").with_stdout("24").run();
/// }
/// ```
#[must_use]
pub struct Package {