use assert_cmd::Command;
use std::fs;
use tempfile::tempdir;
#[test]
#[allow(deprecated)]
fn test_config_load_swallows_parse_error() {
let temp_dir = tempdir().expect("failed to create temp dir");
let config_path = temp_dir.path().join("config.toml");
let invalid_toml = r#"
[general]
verbose = true
color = "always"
invalid_syntax_here =
"#;
fs::write(&config_path, invalid_toml).expect("failed to write config file");
let mut cmd = Command::cargo_bin("dcg").expect("failed to find binary");
cmd.env("DCG_CONFIG", &config_path).arg("config");
let assert = cmd.assert();
assert
.success()
.stdout(predicates::str::contains("Verbose: false")); }