()
| 470 | |
| 471 | #[test] |
| 472 | fn test_remove_counter() { |
| 473 | let mut registry = MetricsRegistry::new("default".to_string()); |
| 474 | |
| 475 | let counter = registry.counter_mut("test_counter", "test counter"); |
| 476 | counter.inc(); |
| 477 | |
| 478 | let buffer = registry.export_metrics().unwrap(); |
| 479 | let output = String::from_utf8(buffer).unwrap(); |
| 480 | |
| 481 | assert!(output.contains("default_test_counter 1")); |
| 482 | |
| 483 | registry.remove_counter("test_counter"); |
| 484 | |
| 485 | let buffer = registry.export_metrics().unwrap(); |
| 486 | let output = String::from_utf8(buffer).unwrap(); |
| 487 | |
| 488 | assert!(!output.contains("default_test_counter 1")); |
| 489 | } |
| 490 | |
| 491 | #[test] |
| 492 | fn test_remove_gauge_vec() { |
nothing calls this directly
no test coverage detected