Skip to content

Commit

Permalink
fix(test): Un-deprecate contains assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Nov 7, 2024
1 parent d20216c commit af3cfd5
Show file tree
Hide file tree
Showing 36 changed files with 0 additions and 106 deletions.
5 changes: 0 additions & 5 deletions crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,6 @@ impl Execs {
/// - `expected` can end up being ambiguous, causing the assertion to succeed when it should fail
///
/// </div>
#[deprecated(note = "replaced with `Execs::with_stdout_data(expected)`")]
pub fn with_stdout_contains<S: ToString>(&mut self, expected: S) -> &mut Self {
self.expect_stdout_contains.push(expected.to_string());
self
Expand All @@ -834,7 +833,6 @@ impl Execs {
/// - `expected` can end up being ambiguous, causing the assertion to succeed when it should fail
///
/// </div>
#[deprecated(note = "replaced with `Execs::with_stderr_data(expected)`")]
pub fn with_stderr_contains<S: ToString>(&mut self, expected: S) -> &mut Self {
self.expect_stderr_contains.push(expected.to_string());
self
Expand All @@ -857,7 +855,6 @@ impl Execs {
/// [`Execs::with_stdout_contains`].
///
/// </div>
#[deprecated]
pub fn with_stdout_does_not_contain<S: ToString>(&mut self, expected: S) -> &mut Self {
self.expect_stdout_not_contains.push(expected.to_string());
self
Expand All @@ -879,7 +876,6 @@ impl Execs {
/// with [`Execs::with_stderr_line_without`].
///
/// </div>
#[deprecated]
pub fn with_stderr_does_not_contain<S: ToString>(&mut self, expected: S) -> &mut Self {
self.expect_stderr_not_contains.push(expected.to_string());
self
Expand Down Expand Up @@ -916,7 +912,6 @@ impl Execs {
/// This will check that a build line includes `-C opt-level=3` but does
/// not contain `-C debuginfo` or `-C incremental`.
///
#[deprecated]
pub fn with_stderr_line_without<S: ToString>(
&mut self,
with: &[S],
Expand Down
5 changes: 0 additions & 5 deletions tests/testsuite/artifact_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ fn build_script_with_bin_artifact_and_lib_false() {
)
.build();

#[expect(deprecated)]
p.cargo("build -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_status(101)
Expand Down Expand Up @@ -731,7 +730,6 @@ fn lib_with_bin_artifact_and_lib_false() {
)
.build();

#[expect(deprecated)]
p.cargo("build -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_status(101)
Expand Down Expand Up @@ -1117,7 +1115,6 @@ fn build_script_deps_adopt_specified_target_unconditionally() {
.file("bar/src/lib.rs", "pub fn doit() {}")
.build();

#[expect(deprecated)]
p.cargo("check -v -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_stderr_does_not_contain(
Expand Down Expand Up @@ -1233,7 +1230,6 @@ fn non_build_script_deps_adopt_specified_target_unconditionally() {
.file("bar/src/lib.rs", "pub fn doit() {}")
.build();

#[expect(deprecated)]
p.cargo("check -v -Z bindeps")
.masquerade_as_nightly_cargo(&["bindeps"])
.with_stderr_contains(
Expand Down Expand Up @@ -1378,7 +1374,6 @@ fn build_script_deps_adopts_target_platform_if_target_equals_target() {
.build();

let alternate_target = cross_compile::alternate();
#[expect(deprecated)]
p.cargo("check -v -Z bindeps --target")
.arg(alternate_target)
.masquerade_as_nightly_cargo(&["bindeps"])
Expand Down
6 changes: 0 additions & 6 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ fn cargo_compile_incremental() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn incremental_profile() {
let p = project()
Expand Down Expand Up @@ -176,7 +175,6 @@ fn incremental_profile() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn incremental_config() {
let p = project()
Expand Down Expand Up @@ -5180,7 +5178,6 @@ WRAPPER CALLED: rustc --crate-name foo [..]
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn rustc_wrapper_queries() {
// Check that the invocations querying rustc for information are done with the wrapper.
Expand Down Expand Up @@ -5920,7 +5917,6 @@ fn build_filter_infer_profile() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn targets_selected_default() {
let p = project().file("src/main.rs", "fn main() {}").build();
Expand Down Expand Up @@ -6874,7 +6870,6 @@ Caused by:
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn build_script_o0_default() {
let p = project()
Expand All @@ -6887,7 +6882,6 @@ fn build_script_o0_default() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn build_script_o0_default_even_with_release() {
let p = project()
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/build_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3779,7 +3779,6 @@ fn custom_target_dir() {
p.cargo("build -v").run();
}

#[expect(deprecated)]
#[cargo_test]
fn panic_abort_with_build_scripts() {
let p = project()
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/build_script_extra_link_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ the future. For more information, see <https://github.com/rust-lang/cargo/issues
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn link_arg_transitive_not_allowed() {
// Verify that transitive dependencies don't pass link args.
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/cache_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ WRAPPER CALLED: rustc [..]
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn wacky_hashless_fingerprint() {
// On Windows, executables don't have hashes. This checks for a bad
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/cargo_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ fn list_command_looks_at_path_case_mismatch() {
);
}

#[expect(deprecated)]
#[cargo_test]
fn list_command_handles_known_external_commands() {
let p = project()
Expand Down
8 changes: 0 additions & 8 deletions tests/testsuite/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ fn check_all() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn check_all_exclude() {
let p = project()
Expand All @@ -433,7 +432,6 @@ fn check_all_exclude() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn check_all_exclude_glob() {
let p = project()
Expand Down Expand Up @@ -491,7 +489,6 @@ fn check_virtual_all_implied() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn check_virtual_manifest_one_project() {
let p = project()
Expand All @@ -518,7 +515,6 @@ fn check_virtual_manifest_one_project() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn check_virtual_manifest_glob() {
let p = project()
Expand Down Expand Up @@ -559,7 +555,6 @@ fn exclude_warns_on_non_existing_package() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn targets_selected_default() {
let foo = project()
Expand Down Expand Up @@ -633,7 +628,6 @@ error[E0425]: cannot find value `badtext` in this scope
.run();
}

#[expect(deprecated)]
// Verify what is checked with various command-line filters.
#[cargo_test]
fn check_filters() {
Expand Down Expand Up @@ -1000,7 +994,6 @@ WRAPPER CALLED: rustc --crate-name foo [..]
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn rustc_workspace_wrapper_respects_primary_units() {
let p = project()
Expand All @@ -1024,7 +1017,6 @@ fn rustc_workspace_wrapper_respects_primary_units() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn rustc_workspace_wrapper_excludes_published_deps() {
let p = project()
Expand Down
22 changes: 0 additions & 22 deletions tests/testsuite/check_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ macro_rules! x {
}};
}

#[expect(deprecated)]
#[cargo_test]
fn features() {
let p = project()
Expand All @@ -56,7 +55,6 @@ fn features() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_with_deps() {
let p = project()
Expand Down Expand Up @@ -87,7 +85,6 @@ fn features_with_deps() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_with_opt_deps() {
let p = project()
Expand Down Expand Up @@ -119,7 +116,6 @@ fn features_with_opt_deps() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_with_namespaced_features() {
let p = project()
Expand Down Expand Up @@ -150,7 +146,6 @@ fn features_with_namespaced_features() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_fingerprint() {
let p = project()
Expand Down Expand Up @@ -228,7 +223,6 @@ fn features_fingerprint() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn well_known_names_values() {
let p = project()
Expand All @@ -242,7 +236,6 @@ fn well_known_names_values() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_test() {
let p = project()
Expand All @@ -268,7 +261,6 @@ fn features_test() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_doctest() {
let p = project()
Expand Down Expand Up @@ -297,7 +289,6 @@ fn features_doctest() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn well_known_names_values_test() {
let p = project()
Expand All @@ -311,7 +302,6 @@ fn well_known_names_values_test() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn well_known_names_values_doctest() {
let p = project()
Expand All @@ -327,7 +317,6 @@ fn well_known_names_values_doctest() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn features_doc() {
let p = project()
Expand All @@ -354,7 +343,6 @@ fn features_doc() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn build_script_feedback() {
let p = project()
Expand Down Expand Up @@ -382,7 +370,6 @@ fn build_script_feedback() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn build_script_doc() {
let p = project()
Expand Down Expand Up @@ -421,7 +408,6 @@ fn build_script_doc() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn build_script_override() {
let target = cargo_test_support::rustc_host();
Expand Down Expand Up @@ -531,7 +517,6 @@ test [..] ... ok
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_simple() {
let p = project()
Expand All @@ -557,7 +542,6 @@ fn config_simple() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_workspace() {
let p = project()
Expand Down Expand Up @@ -599,7 +583,6 @@ fn config_workspace() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_workspace_not_inherited() {
let p = project()
Expand Down Expand Up @@ -631,7 +614,6 @@ fn config_workspace_not_inherited() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_invalid_position() {
let p = project()
Expand Down Expand Up @@ -746,7 +728,6 @@ Caused by:
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_and_features() {
let p = project()
Expand Down Expand Up @@ -836,7 +817,6 @@ fn config_with_cargo_test() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_and_build_script() {
let p = project()
Expand Down Expand Up @@ -866,7 +846,6 @@ fn config_and_build_script() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_features_and_build_script() {
let p = project()
Expand Down Expand Up @@ -902,7 +881,6 @@ fn config_features_and_build_script() {
.run();
}

#[expect(deprecated)]
#[cargo_test]
fn config_fingerprint() {
let p = project()
Expand Down
Loading

0 comments on commit af3cfd5

Please sign in to comment.