MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / array_variant_roundtrip

Function array_variant_roundtrip

nodedb-wal/src/temporal_purge.rs:180–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178
179 #[test]
180 fn array_variant_roundtrip() {
181 let p = TemporalPurgePayload::new(
182 TemporalPurgeEngine::Array,
183 "my_array",
184 1_700_000_000_000,
185 99,
186 );
187 let bytes = p.to_bytes().unwrap();
188 let decoded = TemporalPurgePayload::from_bytes(&bytes).unwrap();
189 assert_eq!(decoded.engine, TemporalPurgeEngine::Array);
190 assert_eq!(decoded.name, "my_array");
191 assert_eq!(decoded.cutoff_system_ms, 1_700_000_000_000);
192 assert_eq!(decoded.purged_count, 99);
193 }
194
195 #[test]
196 fn rejects_unknown_engine_tag() {

Callers

nothing calls this directly

Calls 1

to_bytesMethod · 0.45

Tested by

no test coverage detected