Add a roundtrip test to kill a mutant

There is a mutant found in relative locktime `to_512_second_intervals`.

Add a round trip test to kill the mutant.
This commit is contained in:
Jamil Lambert, PhD 2025-06-19 17:32:30 +01:00
parent 0b4b17307d
commit bd50943234
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
1 changed files with 7 additions and 0 deletions

View File

@ -307,6 +307,13 @@ mod tests {
assert_eq!(NumberOf512Seconds::from_512_second_intervals(1).to_seconds(), 512);
}
#[test]
fn from_512_second_intervals_roundtrip() {
let intervals = 100_u16;
let locktime = NumberOf512Seconds::from_512_second_intervals(intervals);
assert_eq!(locktime.to_512_second_intervals(), intervals);
}
#[test]
fn from_seconds_ceil_success() {
let actual = NumberOf512Seconds::from_seconds_ceil(100).unwrap();