From 76dd6100a27c2fcc4d0ae94d689eb6bf06a9ad61 Mon Sep 17 00:00:00 2001 From: jamillambert Date: Tue, 3 Jun 2025 10:58:54 +0100 Subject: [PATCH] Split derivation path test into valid and invalid Make the tests separate to make tests smaller and easier to read. There are no logic changes. --- bitcoin/src/bip32.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitcoin/src/bip32.rs b/bitcoin/src/bip32.rs index 22ed79d7a..8854e28d5 100644 --- a/bitcoin/src/bip32.rs +++ b/bitcoin/src/bip32.rs @@ -1098,7 +1098,7 @@ mod tests { use super::*; #[test] - fn parse_derivation_path() { + fn parse_derivation_path_invalid() { assert!(matches!( "n/0'/0".parse::(), Err(ParseChildNumberError::ParseInt(..)), @@ -1119,7 +1119,10 @@ mod tests { "2147483648".parse::(), Err(ParseChildNumberError::IndexOutOfRange(IndexOutOfRangeError { index: 2147483648 })), ); + } + #[test] + fn parse_derivation_path_valid() { assert_eq!(DerivationPath::master(), "".parse::().unwrap()); assert_eq!(DerivationPath::master(), DerivationPath::default());