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

Function string_coord_roundtrip

nodedb-array/src/codec/coord_delta.rs:343–360  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342 #[test]
343 fn string_coord_roundtrip() {
344 let mut d = DimDict {
345 values: vec![],
346 indices: vec![],
347 };
348 for s in &["ALT", "REF", "ALT", "DEL"] {
349 let cv = CoordValue::String(s.to_string());
350 if let Some(idx) = d.values.iter().position(|x| x == &cv) {
351 d.indices.push(idx as u32);
352 } else {
353 d.indices.push(d.values.len() as u32);
354 d.values.push(cv);
355 }
356 }
357 let out = roundtrip(&d);
358 assert_eq!(out.indices, d.indices);
359 assert_eq!(out.values, d.values);
360 }
361
362 #[test]
363 fn zero_tag_byte_is_corruption() {

Callers

nothing calls this directly

Calls 5

to_stringMethod · 0.80
roundtripFunction · 0.70
iterMethod · 0.45
pushMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected