chore: refactor test (#2007)

This commit is contained in:
Marcio Diaz
2019-03-15 13:12:36 +01:00
committed by GitHub
parent 32ae38c79d
commit ae1351cb79
+5 -20
View File
@@ -158,26 +158,6 @@ fn sync_from_two_peers_with_ancestry_search_works() {
.canon_equals_to(net.peer(1).client.backend().as_in_memory().blockchain()));
}
#[test]
fn ancestry_search_works_when_common_is_hundred() {
let _ = ::env_logger::try_init();
let mut net = TestNet::new(3);
net.peer(0).push_blocks(100, false);
net.peer(1).push_blocks(100, false);
net.peer(2).push_blocks(100, false);
net.peer(0).push_blocks(10, true);
net.peer(1).push_blocks(100, false);
net.peer(2).push_blocks(100, false);
net.restart_peer(0);
net.sync();
assert!(net.peer(0).client.backend().as_in_memory().blockchain()
.canon_equals_to(net.peer(1).client.backend().as_in_memory().blockchain()));
}
#[test]
fn ancestry_search_works_when_backoff_is_one() {
let _ = ::env_logger::try_init();
@@ -218,6 +198,11 @@ fn ancestry_search_works_when_common_is_two() {
test_ancestor_search_when_common_is(2);
}
#[test]
fn ancestry_search_works_when_common_is_hundred() {
test_ancestor_search_when_common_is(100);
}
#[test]
fn sync_long_chain_works() {
let mut net = TestNet::new(2);