mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 11:13:34 +00:00
Add tests, fix bugs
This commit is contained in:
@@ -28,6 +28,7 @@ where
|
||||
assert_eq!(standard_root, cached_root, "Initial cache build failed.");
|
||||
|
||||
for (i, modified) in modified.iter().enumerate() {
|
||||
println!("-- Start of modification {} --", i);
|
||||
// Test after a modification
|
||||
hasher
|
||||
.update(modified)
|
||||
@@ -161,6 +162,24 @@ fn test_vec() {
|
||||
test_routine(original, modified);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_nested_list() {
|
||||
let original: Vec<Vec<u64>> = vec![vec![1]];
|
||||
|
||||
let modified = vec![
|
||||
vec![vec![1]],
|
||||
vec![vec![1], vec![2]],
|
||||
vec![vec![1], vec![3], vec![4]],
|
||||
vec![],
|
||||
vec![vec![1], vec![3], vec![4]],
|
||||
vec![],
|
||||
vec![vec![1, 2], vec![3], vec![4, 5, 6, 7, 8]],
|
||||
vec![],
|
||||
];
|
||||
|
||||
test_routine(original, modified);
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Inner {
|
||||
pub a: u64,
|
||||
|
||||
Reference in New Issue
Block a user