From e67fe486ffda593425e9183ecba2ed4dab36c678 Mon Sep 17 00:00:00 2001 From: Bruce Guenter Date: Thu, 30 Nov 2023 12:23:39 -0600 Subject: [PATCH] chore(tests): Fix event `size_of` test The strings used in this test are actually object map keys, which must have the type `KeyString`. This works now when `KeyString` is a simple wrapping of `String` but breaks if the types are different. --- lib/vector-core/src/event/test/size_of.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/vector-core/src/event/test/size_of.rs b/lib/vector-core/src/event/test/size_of.rs index 6db19a96db1e1..e3fdc463fce1a 100644 --- a/lib/vector-core/src/event/test/size_of.rs +++ b/lib/vector-core/src/event/test/size_of.rs @@ -72,16 +72,16 @@ fn size_greater_than_allocated_size() { #[derive(Debug, Clone)] pub(crate) enum Action { Contains { - key: String, + key: KeyString, }, SizeOf, /// Insert a key/value pair into the [`LogEvent`] InsertFlat { - key: String, + key: KeyString, value: Value, }, Remove { - key: String, + key: KeyString, }, } @@ -89,15 +89,15 @@ impl Arbitrary for Action { fn arbitrary(g: &mut Gen) -> Self { match u8::arbitrary(g) % 3 { 0 => Action::InsertFlat { - key: String::from(Name::arbitrary(g)), + key: String::from(Name::arbitrary(g)).into(), value: Value::arbitrary(g), }, 1 => Action::SizeOf, 2 => Action::Contains { - key: String::from(Name::arbitrary(g)), + key: String::from(Name::arbitrary(g)).into(), }, 3 => Action::Remove { - key: String::from(Name::arbitrary(g)), + key: String::from(Name::arbitrary(g)).into(), }, _ => unreachable!(), }