test(chain): LocalChain
test for update that is shorter than original
This commit is contained in:
parent
9467cad55d
commit
8f2d4d9d40
@ -292,6 +292,27 @@ fn update_local_chain() {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Allow update that is shorter than original chain
|
||||||
|
// | 0 | 1 | 2 | 3 | 4 | 5
|
||||||
|
// chain | A C D E F
|
||||||
|
// update | A C D'
|
||||||
|
TestLocalChain {
|
||||||
|
name: "allow update that is shorter than original chain",
|
||||||
|
chain: local_chain![(0, h!("_")), (2, h!("C")), (3, h!("D")), (4, h!("E")), (5, h!("F"))],
|
||||||
|
update: chain_update![(0, h!("_")), (2, h!("C")), (3, h!("D'"))],
|
||||||
|
exp: ExpectedResult::Ok {
|
||||||
|
changeset: &[
|
||||||
|
(3, Some(h!("D'"))),
|
||||||
|
(4, None),
|
||||||
|
(5, None),
|
||||||
|
],
|
||||||
|
init_changeset: &[
|
||||||
|
(0, Some(h!("_"))),
|
||||||
|
(2, Some(h!("C"))),
|
||||||
|
(3, Some(h!("D'"))),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.for_each(TestLocalChain::run);
|
.for_each(TestLocalChain::run);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user