feat: Add more tests to b2p edge cases

This commit is contained in:
0xalivecow 2024-11-02 14:18:10 +01:00
parent 8db0bbaa63
commit 26ca12b419
No known key found for this signature in database
2 changed files with 64 additions and 18 deletions

View file

@ -51,4 +51,46 @@ mod tests {
Ok(())
}
#[test]
fn block2poly_task03() -> Result<()> {
let block: Value = json!({"block" : "AAAAAAAAAAAAAAAAAAAAAA==", "semantic" : "gcm"});
let coefficients: Vec<u8> = vec![];
assert_eq!(
block2poly(&block)?,
coefficients,
"Coefficients were: {:?}",
block2poly(&block)?
);
Ok(())
}
#[test]
fn block2poly_task04() -> Result<()> {
let block: Value = json!({"block" : "", "semantic" : "gcm"});
let coefficients: Vec<u8> = vec![];
assert_eq!(
block2poly(&block)?,
coefficients,
"Coefficients were: {:?}",
block2poly(&block)?
);
Ok(())
}
#[test]
fn block2poly_task_empty_xex() -> Result<()> {
let block: Value = json!({"block" : "", "semantic" : "xex"});
let coefficients: Vec<u8> = vec![];
assert_eq!(
block2poly(&block)?,
coefficients,
"Coefficients were: {:?}",
block2poly(&block)?
);
Ok(())
}
}