()
| 5436 | |
| 5437 | #[test] |
| 5438 | fn test_safe_write_json_file() { |
| 5439 | let dir = TempDir::new().unwrap(); |
| 5440 | let path = dir.path().join("output.json"); |
| 5441 | let value = serde_json::json!({"hello": "world"}); |
| 5442 | safe_write_json_file(&path, &value, None).unwrap(); |
| 5443 | let content: serde_json::Value = |
| 5444 | serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap(); |
| 5445 | assert_eq!(content["hello"], "world"); |
| 5446 | } |
| 5447 | |
| 5448 | #[test] |
| 5449 | fn test_safe_write_json_file_creates_parent_dirs() { |
nothing calls this directly
no test coverage detected