()
| 278 | |
| 279 | #[test] |
| 280 | fn test_search_load_config_nested() { |
| 281 | let temp_dir = TempDir::new().unwrap(); |
| 282 | let dir_path = temp_dir.path().to_str().unwrap(); |
| 283 | |
| 284 | // Write nested configuration |
| 285 | fs::write( |
| 286 | temp_dir.path().join("app.toml"), |
| 287 | r#" |
| 288 | [config] |
| 289 | override = "nested_from_toml" |
| 290 | "#, |
| 291 | ) |
| 292 | .unwrap(); |
| 293 | |
| 294 | let default_toml = r#" |
| 295 | [config] |
| 296 | foo = "nested_value" |
| 297 | override = "default" |
| 298 | "#; |
| 299 | |
| 300 | let result = |
| 301 | search_load_config("app", &[dir_path], default_toml, None, true).select("config"); |
| 302 | |
| 303 | assert_eq!( |
| 304 | result.extract_inner::<String>("foo").unwrap(), |
| 305 | "nested_value" |
| 306 | ); |
| 307 | assert_eq!( |
| 308 | result.extract_inner::<String>("override").unwrap(), |
| 309 | "nested_from_toml" |
| 310 | ); |
| 311 | } |
| 312 | } |
nothing calls this directly
no test coverage detected