From 4216fa6f6f040a6ec73c2e391ea855725ee63854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gillot-Lamure?= Date: Wed, 17 Jul 2024 20:44:20 +0200 Subject: [PATCH] chore: add missing tests for u32 i32 that already work in metrics (#215) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Léo Gillot-Lamure --- src/encoding/text.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/encoding/text.rs b/src/encoding/text.rs index 216ddde..7cf22e4 100644 --- a/src/encoding/text.rs +++ b/src/encoding/text.rs @@ -709,7 +709,7 @@ mod tests { use crate::metrics::{counter::Counter, exemplar::CounterWithExemplar}; use pyo3::{prelude::*, types::PyModule}; use std::borrow::Cow; - use std::sync::atomic::AtomicU32; + use std::sync::atomic::{AtomicI32, AtomicU32}; #[test] fn encode_counter() { @@ -717,6 +717,9 @@ mod tests { let mut registry = Registry::default(); registry.register("my_counter", "My counter", counter); + let counter_u32 = Counter::::default(); + registry.register("u32_counter", "Counter::", counter_u32); + let mut encoded = String::new(); encode(&mut encoded, ®istry).unwrap(); @@ -780,6 +783,9 @@ mod tests { let gauge = Gauge::::default(); registry.register("u32_gauge", "Gauge::", gauge); + let gauge_i32 = Gauge::::default(); + registry.register("i32_gauge", "Gauge::", gauge_i32); + let mut encoded = String::new(); encode(&mut encoded, ®istry).unwrap();