Merge rust-bitcoin/rust-bitcoin#4037: primitives: Add tests to LockTime
6cecc40ae4
Test LockTime PartialOrd (Jamil Lambert, PhD) Pull request description: Add tests to kill the mutants in both relative and absolute PartialOrd. ACKs for top commit: tcharding: ACK6cecc40ae4
apoelstra: ACK 6cecc40ae4d52b711f58998315155bc8c6b19d7b; successfully ran local tests; thanks! Tree-SHA512: dba7d90e3f6e62f0d3417bacc09d38145dd29bf654f84c2d3bc68af30c0e65b105146466a384bd35ef4326913ca414fd31f92daa3d7ffe3ff409c49bd1c05d96
This commit is contained in:
commit
007f4d3362
|
@ -501,6 +501,9 @@ mod tests {
|
|||
assert!(lock_by_height.is_satisfied_by(height_same, time));
|
||||
assert!(lock_by_height.is_satisfied_by(height_above, time));
|
||||
assert!(!lock_by_height.is_satisfied_by(height_below, time));
|
||||
|
||||
let lock_by_height_above = LockTime::from_consensus(800_000);
|
||||
assert!(lock_by_height < lock_by_height_above)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -516,6 +519,9 @@ mod tests {
|
|||
assert!(lock_by_time.is_satisfied_by(height, time_same));
|
||||
assert!(lock_by_time.is_satisfied_by(height, time_after));
|
||||
assert!(!lock_by_time.is_satisfied_by(height, time_before));
|
||||
|
||||
let lock_by_time_after = LockTime::from_consensus(1653282000);
|
||||
assert!(lock_by_time < lock_by_time_after);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -501,6 +501,9 @@ mod tests {
|
|||
assert!(!lock_by_height1.is_same_unit(lock_by_time1));
|
||||
assert!(lock_by_time1.is_same_unit(lock_by_time2));
|
||||
assert!(!lock_by_time1.is_same_unit(lock_by_height1));
|
||||
|
||||
assert!(lock_by_height1 < lock_by_height2);
|
||||
assert!(lock_by_time1 < lock_by_time2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in New Issue