()
| 5487 | |
| 5488 | #[test] |
| 5489 | fn test_load_toml_file_valid() { |
| 5490 | let dir = TempDir::new().unwrap(); |
| 5491 | let path = dir.path().join("test.toml"); |
| 5492 | std::fs::write(&path, "key = \"value\"\nnumber = 42\n").unwrap(); |
| 5493 | let val = load_toml_file(&path).expect("valid TOML should parse as document"); |
| 5494 | let table = val.as_table().expect("top-level should be a table"); |
| 5495 | assert_eq!(table.get("key").and_then(|v| v.as_str()), Some("value")); |
| 5496 | assert_eq!(table.get("number").and_then(|v| v.as_integer()), Some(42)); |
| 5497 | } |
| 5498 | |
| 5499 | #[test] |
| 5500 | fn test_load_toml_file_invalid_returns_err() { |
nothing calls this directly
no test coverage detected