helpers4 0.0.6

General-purpose Rust helpers, one crate, one feature per module (string, array, ...)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This file is part of helpers4.
// Copyright (C) 2025 baxyz
// SPDX-License-Identifier: LGPL-3.0-or-later

use super::*;
use proptest::prelude::*;

proptest! {
    #[test]
    fn round_trips_with_encode(bytes in any::<[u8; 8]>()) {
        let hex = crate::hex::encode(&bytes);
        prop_assert_eq!(decode_array::<8>(&hex).unwrap(), bytes);
        prop_assert!(decode_array::<8>(&hex[..hex.len() - 2]).is_err());
    }
}