()
| 346 | |
| 347 | #[test] |
| 348 | fn test_format_node_details_csv_escaping() { |
| 349 | use crate::format::OutputFormat; |
| 350 | |
| 351 | // Regular name |
| 352 | let out_normal = format_node_details(123, "MyClass", 100, OutputFormat::Text).unwrap(); |
| 353 | assert_eq!(out_normal, "nodeId,nodeName,selfSize\n123,MyClass,100\n"); |
| 354 | |
| 355 | // Name with comma |
| 356 | let out_comma = format_node_details(123, "My,Class", 100, OutputFormat::Text).unwrap(); |
| 357 | assert_eq!(out_comma, "nodeId,nodeName,selfSize\n123,\"My,Class\",100\n"); |
| 358 | |
| 359 | // Name with quotes |
| 360 | let out_quotes = format_node_details(123, "My\"Class", 100, OutputFormat::Text).unwrap(); |
| 361 | assert_eq!(out_quotes, "nodeId,nodeName,selfSize\n123,\"My\"\"Class\",100\n"); |
| 362 | |
| 363 | // Name with newline |
| 364 | let out_nl = format_node_details(123, "My\nClass", 100, OutputFormat::Text).unwrap(); |
| 365 | assert_eq!(out_nl, "nodeId,nodeName,selfSize\n123,\"My\nClass\",100\n"); |
| 366 | } |
| 367 | |
| 368 | #[test] |
| 369 | fn test_format_node_details_structured() { |
nothing calls this directly
no test coverage detected