]> git.proxmox.com Git - cargo.git/blobdiff - tests/testsuite/config_include.rs
New upstream version 0.66.0
[cargo.git] / tests / testsuite / config_include.rs
index ac210b777cb42b44c50bcbdccf4521a50ac867a8..f605d087e88939fc49734bfa6ecc404f31160bac 100644 (file)
@@ -1,8 +1,7 @@
 //! Tests for `include` config field.
 
 use super::config::{assert_error, write_config, write_config_at, ConfigBuilder};
-use cargo_test_support::{no_such_file_err_msg, paths, project};
-use std::fs;
+use cargo_test_support::{no_such_file_err_msg, project};
 
 #[cargo_test]
 fn gated() {
@@ -72,7 +71,7 @@ fn works_with_cli() {
         )
         .run();
     p.cargo("build -v -Z config-include")
-        .masquerade_as_nightly_cargo()
+        .masquerade_as_nightly_cargo(&["config-include"])
         .with_stderr(
             "\
 [COMPILING] foo v0.0.1 [..]
@@ -255,34 +254,3 @@ Caused by:
   expected array, but found string",
     );
 }
-
-#[cargo_test]
-fn cli_path() {
-    // --config path_to_file
-    fs::write(paths::root().join("myconfig.toml"), "key = 123").unwrap();
-    let config = ConfigBuilder::new()
-        .cwd(paths::root())
-        .unstable_flag("config-include")
-        .config_arg("myconfig.toml")
-        .build();
-    assert_eq!(config.get::<u32>("key").unwrap(), 123);
-
-    let config = ConfigBuilder::new()
-        .unstable_flag("config-include")
-        .config_arg("missing.toml")
-        .build_err();
-    assert_error(
-        config.unwrap_err(),
-        "\
-failed to parse value from --config argument `missing.toml` as a dotted key expression
-
-Caused by:
-  TOML parse error at line 1, column 13
-  |
-1 | missing.toml
-  |             ^
-Unexpected end of input
-Expected `.` or `=`
-",
-    );
-}