Skip to content

Commit 76e5433

Browse files
committed
Added test for unknown templating variables
1 parent ba4df9f commit 76e5433

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/testsuite/build_dir.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,26 @@ fn future_incompat_should_output_to_build_dir() {
491491
assert_exists(&p.root().join("build-dir/.future-incompat-report.json"));
492492
}
493493

494+
#[cargo_test]
495+
fn template_should_error_for_invalid_variables() {
496+
let p = project()
497+
.file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
498+
.file(
499+
".cargo/config.toml",
500+
r#"
501+
[build]
502+
build-dir = "{fake}/build-dir"
503+
target-dir = "target-dir"
504+
"#,
505+
)
506+
.build();
507+
508+
p.cargo("build -Z build-dir")
509+
.masquerade_as_nightly_cargo(&["build-dir"])
510+
.enable_mac_dsym()
511+
.run();
512+
}
513+
494514
#[cargo_test]
495515
fn template_workspace_root() {
496516
let p = project()

0 commit comments

Comments
 (0)