|
1 | 1 | //! Tests specific to artifact dependencies, designated using
|
2 | 2 | //! the new `dep = { artifact = "bin", … }` syntax in manifests.
|
3 | 3 |
|
4 |
| -use cargo_test_support::compare::match_exact; |
| 4 | +use cargo_test_support::compare; |
5 | 5 | use cargo_test_support::registry::{Package, RegistryBuilder};
|
6 | 6 | use cargo_test_support::{
|
7 | 7 | basic_bin_manifest, basic_manifest, cross_compile, project, publish, registry, rustc_host,
|
@@ -593,35 +593,27 @@ fn build_script_with_bin_artifacts() {
|
593 | 593 | .run();
|
594 | 594 |
|
595 | 595 | let build_script_output = build_script_output_string(&p, "foo");
|
596 |
| - let msg = "we need the binary directory for this artifact along with all binary paths"; |
| 596 | + // we need the binary directory for this artifact along with all binary paths |
597 | 597 | if cfg!(target_env = "msvc") {
|
598 |
| - match_exact( |
| 598 | + compare::assert_match_exact( |
599 | 599 | "[..]/artifact/bar-[..]/bin/baz.exe\n\
|
600 | 600 | [..]/artifact/bar-[..]/staticlib/bar-[..].lib\n\
|
601 | 601 | [..]/artifact/bar-[..]/cdylib/bar.dll\n\
|
602 | 602 | [..]/artifact/bar-[..]/bin\n\
|
603 | 603 | [..]/artifact/bar-[..]/bin/bar.exe\n\
|
604 | 604 | [..]/artifact/bar-[..]/bin/bar.exe",
|
605 | 605 | &build_script_output,
|
606 |
| - msg, |
607 |
| - "", |
608 |
| - None, |
609 | 606 | )
|
610 |
| - .unwrap(); |
611 | 607 | } else {
|
612 |
| - match_exact( |
| 608 | + compare::assert_match_exact( |
613 | 609 | "[..]/artifact/bar-[..]/bin/baz-[..]\n\
|
614 | 610 | [..]/artifact/bar-[..]/staticlib/libbar-[..].a\n\
|
615 | 611 | [..]/artifact/bar-[..]/cdylib/[..]bar.[..]\n\
|
616 | 612 | [..]/artifact/bar-[..]/bin\n\
|
617 | 613 | [..]/artifact/bar-[..]/bin/bar-[..]\n\
|
618 | 614 | [..]/artifact/bar-[..]/bin/bar-[..]",
|
619 | 615 | &build_script_output,
|
620 |
| - msg, |
621 |
| - "", |
622 |
| - None, |
623 | 616 | )
|
624 |
| - .unwrap(); |
625 | 617 | }
|
626 | 618 |
|
627 | 619 | assert!(
|
@@ -783,31 +775,22 @@ fn build_script_with_selected_dashed_bin_artifact_and_lib_true() {
|
783 | 775 | .run();
|
784 | 776 |
|
785 | 777 | let build_script_output = build_script_output_string(&p, "foo");
|
786 |
| - let msg = "we need the binary directory for this artifact and the binary itself"; |
787 |
| - |
| 778 | + // we need the binary directory for this artifact and the binary itself |
788 | 779 | if cfg!(target_env = "msvc") {
|
789 |
| - cargo_test_support::compare::match_exact( |
| 780 | + compare::assert_match_exact( |
790 | 781 | &format!(
|
791 | 782 | "[..]/artifact/bar-baz-[..]/bin\n\
|
792 | 783 | [..]/artifact/bar-baz-[..]/bin/baz_suffix{}",
|
793 | 784 | std::env::consts::EXE_SUFFIX,
|
794 | 785 | ),
|
795 | 786 | &build_script_output,
|
796 |
| - msg, |
797 |
| - "", |
798 |
| - None, |
799 |
| - ) |
800 |
| - .unwrap(); |
| 787 | + ); |
801 | 788 | } else {
|
802 |
| - cargo_test_support::compare::match_exact( |
| 789 | + compare::assert_match_exact( |
803 | 790 | "[..]/artifact/bar-baz-[..]/bin\n\
|
804 | 791 | [..]/artifact/bar-baz-[..]/bin/baz_suffix-[..]",
|
805 | 792 | &build_script_output,
|
806 |
| - msg, |
807 |
| - "", |
808 |
| - None, |
809 |
| - ) |
810 |
| - .unwrap(); |
| 793 | + ); |
811 | 794 | }
|
812 | 795 |
|
813 | 796 | assert!(
|
@@ -1757,14 +1740,7 @@ fn allow_dep_renames_with_multiple_versions() {
|
1757 | 1740 | .with_stderr_contains("[COMPILING] foo [..]")
|
1758 | 1741 | .run();
|
1759 | 1742 | let build_script_output = build_script_output_string(&p, "foo");
|
1760 |
| - match_exact( |
1761 |
| - "0.5.0\n1.0.0", |
1762 |
| - &build_script_output, |
1763 |
| - "build script output", |
1764 |
| - "", |
1765 |
| - None, |
1766 |
| - ) |
1767 |
| - .unwrap(); |
| 1743 | + compare::assert_match_exact("0.5.0\n1.0.0", &build_script_output); |
1768 | 1744 | }
|
1769 | 1745 |
|
1770 | 1746 | #[cargo_test]
|
@@ -3240,26 +3216,18 @@ fn build_only_specified_artifact_library() {
|
3240 | 3216 | .cargo("build -Z bindeps")
|
3241 | 3217 | .masquerade_as_nightly_cargo(&["bindeps"])
|
3242 | 3218 | .run();
|
3243 |
| - match_exact( |
| 3219 | + compare::assert_match_exact( |
3244 | 3220 | "cdylib present: true\nstaticlib present: false",
|
3245 | 3221 | &build_script_output_string(&cdylib, "foo"),
|
3246 |
| - "build script output", |
3247 |
| - "", |
3248 |
| - None, |
3249 |
| - ) |
3250 |
| - .unwrap(); |
| 3222 | + ); |
3251 | 3223 |
|
3252 | 3224 | let staticlib = create_project("staticlib");
|
3253 | 3225 | staticlib
|
3254 | 3226 | .cargo("build -Z bindeps")
|
3255 | 3227 | .masquerade_as_nightly_cargo(&["bindeps"])
|
3256 | 3228 | .run();
|
3257 |
| - match_exact( |
| 3229 | + compare::assert_match_exact( |
3258 | 3230 | "cdylib present: false\nstaticlib present: true",
|
3259 | 3231 | &build_script_output_string(&staticlib, "foo"),
|
3260 |
| - "build script output", |
3261 |
| - "", |
3262 |
| - None, |
3263 |
| - ) |
3264 |
| - .unwrap(); |
| 3232 | + ); |
3265 | 3233 | }
|
0 commit comments