test: proptest suite for protocol and COBS framing

Ten properties covering: RadioConfig roundtrip and validate/resolve
determinism; no-panic on arbitrary bytes for both Command::from_bytes
and RadioConfig::from_bytes; bounded-capacity for Transmit payloads
(guards the heapless::Vec size); Command roundtrip via a test-only
encoder (the library only decodes commands); COBS reversibility; and
two streaming CobsDecoder properties (no-panic on random byte streams
with random chunk boundaries, and a full encode→feed→decode roundtrip).

Adds Clone to Command and Response — benign public-API expansion that
unblocks proptest's Just strategy.
This commit is contained in:
swaits committed 2026-04-13 09:03:40 -06:00
1 parent 548cf722c2
commit 79587f9e22
2 files changed
+336 -2

No files matched your search

+2 -2
View File
@@ -156,7 +156,7 @@ impl RadioConfig {
/// Host → firmware commands.
#[allow(clippy::large_enum_variant)]
#[derive(Debug, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
pub enum Command {
Ping,
GetConfig,
@@ -220,7 +220,7 @@ impl Command {
/// Firmware → host responses.
#[allow(clippy::large_enum_variant)]
#[derive(Debug, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
pub enum Response {
Pong,
Config(RadioConfig),