@@ -1472,13 +1472,16 @@ mod tests {
1472
1472
fn duplicate_keys ( ) {
1473
1473
// You cannot parse a Miniscript that has duplicate keys
1474
1474
let err = Miniscript :: < String , Segwitv0 > :: from_str ( "and_v(v:pk(A),pk(A))" ) . unwrap_err ( ) ;
1475
- assert_eq ! ( err, Error :: AnalysisError ( crate :: AnalysisError :: RepeatedPubkeys ) ) ;
1475
+ assert ! ( matches! ( err, Error :: AnalysisError ( crate :: AnalysisError :: RepeatedPubkeys ) ) ) ;
1476
1476
1477
1477
// ...though you can parse one with from_str_insane
1478
1478
let ok_insane =
1479
1479
Miniscript :: < String , Segwitv0 > :: from_str_insane ( "and_v(v:pk(A),pk(A))" ) . unwrap ( ) ;
1480
1480
// ...but this cannot be sanity checked.
1481
- assert_eq ! ( ok_insane. sanity_check( ) . unwrap_err( ) , crate :: AnalysisError :: RepeatedPubkeys ) ;
1481
+ assert ! ( matches!(
1482
+ ok_insane. sanity_check( ) . unwrap_err( ) ,
1483
+ crate :: AnalysisError :: RepeatedPubkeys
1484
+ ) ) ;
1482
1485
// ...it can be lifted, though it's unclear whether this is a deliberate
1483
1486
// choice or just an accident. It seems weird given that duplicate public
1484
1487
// keys are forbidden in several other places.
@@ -1492,7 +1495,10 @@ mod tests {
1492
1495
"and_v(v:and_v(v:older(4194304),pk(A)),and_v(v:older(1),pk(B)))" ,
1493
1496
)
1494
1497
. unwrap_err ( ) ;
1495
- assert_eq ! ( err, Error :: AnalysisError ( crate :: AnalysisError :: HeightTimelockCombination ) ) ;
1498
+ assert ! ( matches!(
1499
+ err,
1500
+ Error :: AnalysisError ( crate :: AnalysisError :: HeightTimelockCombination )
1501
+ ) ) ;
1496
1502
1497
1503
// Though you can in an or() rather than and()
1498
1504
let ok_or = Miniscript :: < String , Segwitv0 > :: from_str (
@@ -1512,10 +1518,10 @@ mod tests {
1512
1518
ok_insane. sanity_check( ) . unwrap_err( ) ,
1513
1519
crate :: AnalysisError :: HeightTimelockCombination
1514
1520
) ;
1515
- assert_eq ! (
1521
+ assert ! ( matches !(
1516
1522
ok_insane. lift( ) . unwrap_err( ) ,
1517
1523
Error :: LiftError ( crate :: policy:: LiftError :: HeightTimelockCombination )
1518
- ) ;
1524
+ ) ) ;
1519
1525
}
1520
1526
1521
1527
#[ test]
0 commit comments