MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / test_format_node_details_csv_escaping

Function test_format_node_details_csv_escaping

src/commands/memory.rs:348–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

format_node_detailsFunction · 0.85

Tested by

no test coverage detected