Skip to content

Commit d5cb6b5

Browse files
committed
test: Add test for issue-14560
1 parent cf781da commit d5cb6b5

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

tests/testsuite/config.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use cargo::CargoResult;
1616
use cargo_test_support::compare::assert_e2e;
1717
use cargo_test_support::prelude::*;
1818
use cargo_test_support::str;
19-
use cargo_test_support::{paths, project, symlink_supported, t};
19+
use cargo_test_support::{paths, project, project_in_home, symlink_supported, t};
2020
use cargo_util_schemas::manifest::TomlTrimPaths;
2121
use cargo_util_schemas::manifest::TomlTrimPathsValue;
2222
use cargo_util_schemas::manifest::{self as cargo_toml, TomlDebugInfo, VecStringOrBool as VSOB};
@@ -299,6 +299,28 @@ f1 = 1
299299
assert_e2e().eq(&output, expected);
300300
}
301301

302+
#[cargo_test]
303+
fn home_config_works_without_extension() {
304+
write_config_at(
305+
paths::cargo_home().join("config"),
306+
"\
307+
[foo]
308+
f1 = 1
309+
",
310+
);
311+
let p = project_in_home("foo").file("src/lib.rs", "").build();
312+
313+
p.cargo("-vV")
314+
.with_stderr_data(str![[r#"
315+
[WARNING] `[ROOT]/home/.cargo/config` is deprecated in favor of `config.toml`
316+
[NOTE] if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
317+
[WARNING] `[ROOT]/home/.cargo/config` is deprecated in favor of `config.toml`
318+
[NOTE] if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
319+
320+
"#]])
321+
.run();
322+
}
323+
302324
#[cargo_test]
303325
fn config_ambiguous_filename_symlink_doesnt_warn() {
304326
// Windows requires special permissions to create symlinks.

0 commit comments

Comments
 (0)