MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / test

Function test

src/pack.rs:600–608  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

598 #[test]
599 fn test_unpack_arithmetic() {
600 fn test<const FACTOR: usize>(bytes: &[u8]) {
601 let packed = pack_arithmetic::<FACTOR>(bytes);
602
603 let mut input = packed.as_slice();
604 let mut bytes2 = vec![];
605 super::unpack_arithmetic::<FACTOR>(&mut input, bytes.len(), &mut bytes2).unwrap();
606 assert!(input.is_empty());
607 assert_eq!(bytes, bytes2);
608 }
609
610 test::<2>(&[1, 0, 1, 0]);
611 test::<2>(&[1, 0, 1, 0, 1, 0, 1, 0]);

Callers

nothing calls this directly

Calls 2

as_sliceMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected