Now with tests for the basic algorithms.

This commit is contained in:
2018-09-28 17:48:35 -05:00
parent 3b68363b49
commit 304d009a67
95 changed files with 271012 additions and 270361 deletions

View File

@@ -67,4 +67,22 @@ macro_rules! generate_codec
generate_decoder!($name);
generate_encoder!($name);
}
}
#[cfg(test)]
macro_rules! generate_codec_tests {
($name: ident, $lname: ident) => {
#[cfg(test)]
mod $lname {
use super::super::super::*;
quickcheck! {
fn decode_encode(x: $name) -> bool {
let bytes = x.to_bytes();
let x2 = $name::from_bytes(&bytes);
x == x2
}
}
}
};
}