Skip to content

Commit 972d534

Browse files
committed
test: Add test for issue #14379
1 parent 73a1b76 commit 972d534

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

tests/testsuite/build_script.rs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use cargo_test_support::tools;
1414
use cargo_test_support::{
1515
basic_manifest, cargo_exe, cross_compile, is_coarse_mtime, project, project_in,
1616
};
17-
use cargo_test_support::{rustc_host, sleep_ms, slow_cpu_multiplier, symlink_supported};
17+
use cargo_test_support::{git, rustc_host, sleep_ms, slow_cpu_multiplier, symlink_supported};
1818
use cargo_util::paths::{self, remove_dir_all};
1919

2020
#[cargo_test]
@@ -5814,3 +5814,36 @@ fn links_overrides_with_target_applies_to_host() {
58145814
"#]])
58155815
.run();
58165816
}
5817+
5818+
#[cargo_test]
5819+
fn directory_with_leading_underscore() {
5820+
let p: cargo_test_support::Project = git::new("foo", |p| {
5821+
p.no_manifest()
5822+
.file(
5823+
"_foo/foo/Cargo.toml",
5824+
r#"
5825+
[package]
5826+
name = "foo"
5827+
version = "0.1.0"
5828+
edition = "2021"
5829+
build = "build.rs"
5830+
"#,
5831+
)
5832+
.file("_foo/foo/src/main.rs", "fn main() {}")
5833+
.file("_foo/foo/build.rs", "fn main() { }")
5834+
});
5835+
p.cargo("build --manifest-path=_foo/foo/Cargo.toml -v")
5836+
.with_status(101)
5837+
.with_stderr_data(r#"[ERROR] failed to determine package fingerprint for build script for foo v0.1.0 ([ROOT]/foo/_foo/foo)
5838+
5839+
Caused by:
5840+
failed to determine the most recently modified file in [ROOT]/foo/_foo/foo
5841+
5842+
Caused by:
5843+
failed to determine list of files in [ROOT]/foo/_foo/foo
5844+
5845+
Caused by:
5846+
Unimplemented short keyword: '_'
5847+
"#)
5848+
.run();
5849+
}

0 commit comments

Comments
 (0)