preserves/implementations/rust/preserves/tests/samples/mod.rs

20 lines
669 B
Rust
Raw Normal View History

2020-06-16 15:46:55 +00:00
use preserves::symbol::Symbol;
use preserves::value::{IOValue, Map};
2021-08-02 09:42:48 +00:00
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2020-06-16 15:46:55 +00:00
pub struct TestCases {
2023-07-21 16:15:30 +00:00
pub tests: Map<Symbol, TestCase>,
2020-06-16 15:46:55 +00:00
}
2021-08-02 09:42:48 +00:00
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2020-06-16 15:46:55 +00:00
pub enum TestCase {
Test(#[serde(with = "serde_bytes")] Vec<u8>, IOValue),
NondeterministicTest(#[serde(with = "serde_bytes")] Vec<u8>, IOValue),
ParseError(String),
ParseShort(String),
ParseEOF(String),
DecodeError(#[serde(with = "serde_bytes")] Vec<u8>),
DecodeShort(#[serde(with = "serde_bytes")] Vec<u8>),
DecodeEOF(#[serde(with = "serde_bytes")] Vec<u8>),
}