Mock-like expectations for TestChainSource
authorJeffrey Czyz <jkczyz@gmail.com>
Sun, 21 Mar 2021 03:54:21 +0000 (23:54 -0400)
committerJeffrey Czyz <jkczyz@gmail.com>
Sat, 27 Mar 2021 22:21:05 +0000 (18:21 -0400)
commit80e81fbea3a53fe88f056fc1761872e3eac5d13e
tree5d150c1da5b2790f5274776c07841ca8be4daa1f
parent6b14adebdbd6acc9a5abf36468e95eeebee75ba4
Mock-like expectations for TestChainSource

Add a method to TestChainSource to test chain::Filter expectations. This
is limited to register_output, allowing tests to assert that the method
was called with a specific output and dictate what the return value is.

Multiple expectations are checked in the order in which they were added.
Failure occurs if a call doesn't match the next expectation or if there
are unsatisfied expectations. If not expectations are added, then no
calls are checked.
lightning/src/util/test_utils.rs