Skip to content

Commit 6fffcee

Browse files
committed
Added tests for host-tuple support
Signed-off-by: Ojus Chugh <ojuschugh@gmail.com>
1 parent ab991e0 commit 6fffcee

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

tests/testsuite/metadata.rs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3842,21 +3842,15 @@ fn filter_platform() {
38423842
.run();
38433843
clear();
38443844

3845-
// Filter on host, removes alt and cfg.
3846-
p.cargo("metadata --filter-platform")
3847-
.arg(&host_target)
3848-
.with_stderr_data(
3849-
str![[r#"
3845+
let host_filtered_stderr = str![[r#"
38503846
[WARNING] please specify `--format-version` flag explicitly to avoid compatibility problems
38513847
[DOWNLOADING] crates ...
38523848
[DOWNLOADED] normal-dep v0.0.1 (registry `dummy-registry`)
38533849
[DOWNLOADED] host-dep v0.0.1 (registry `dummy-registry`)
38543850
3855-
"#]]
3856-
.unordered(),
3857-
)
3858-
.with_stdout_data(
3859-
str![[r#"
3851+
"#]];
3852+
3853+
let host_filtered_stdout = str![[r#"
38603854
{
38613855
"packages": [
38623856
{
@@ -3945,10 +3939,21 @@ fn filter_platform() {
39453939
},
39463940
"...": "{...}"
39473941
}
3948-
"#]]
3949-
.is_json()
3950-
.unordered(),
3951-
)
3942+
"#]];
3943+
3944+
// Filter on host, removes alt and cfg.
3945+
p.cargo("metadata --filter-platform")
3946+
.arg(&host_target)
3947+
.with_stderr_data(host_filtered_stderr.clone().unordered())
3948+
.with_stdout_data(host_filtered_stdout.clone().is_json().unordered())
3949+
.run();
3950+
clear();
3951+
3952+
// Filter on host-tuple, should produce same result as explicit host target.
3953+
p.cargo("metadata --filter-platform")
3954+
.arg("host-tuple")
3955+
.with_stderr_data(host_filtered_stderr.unordered())
3956+
.with_stdout_data(host_filtered_stdout.is_json().unordered())
39523957
.run();
39533958
clear();
39543959

0 commit comments

Comments
 (0)