Skip to content

Commit 2a11c26

Browse files
committed
test(build-dir): Added test for unmatched brackets in build-dir path
1 parent 210ebb5 commit 2a11c26

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/testsuite/build_dir.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,39 @@ fn template_workspace_path_hash_should_handle_symlink() {
684684
}
685685
}
686686

687+
#[cargo_test]
688+
fn template_should_handle_ignore_unmatched_brackets() {
689+
let p = project()
690+
.file("src/lib.rs", "")
691+
.file(
692+
".cargo/config.toml",
693+
r#"
694+
[build]
695+
build-dir = "foo/{bar"
696+
"#,
697+
)
698+
.build();
699+
700+
p.cargo("build -Z build-dir")
701+
.masquerade_as_nightly_cargo(&["build-dir"])
702+
.run();
703+
704+
let p = project()
705+
.file("src/lib.rs", "")
706+
.file(
707+
".cargo/config.toml",
708+
r#"
709+
[build]
710+
build-dir = "foo/}bar"
711+
"#,
712+
)
713+
.build();
714+
715+
p.cargo("build -Z build-dir")
716+
.masquerade_as_nightly_cargo(&["build-dir"])
717+
.run();
718+
}
719+
687720
fn parse_workspace_manifest_path_hash(hash_dir: &PathBuf) -> PathBuf {
688721
// Since the hash will change between test runs simply find the first directories and assume
689722
// that is the hash dir. The format is a 2 char directory followed by the remaining hash in the

0 commit comments

Comments
 (0)