Split invalid derivation path test

The test tests two sperate things.

Split the test into invalid path and out of range.
This commit is contained in:
jamillambert 2025-06-03 11:11:29 +01:00
parent 76dd6100a2
commit 015fb1be3b
No known key found for this signature in database
GPG Key ID: 6152B1CE57C49017
1 changed files with 5 additions and 1 deletions

View File

@ -1098,7 +1098,7 @@ mod tests {
use super::*;
#[test]
fn parse_derivation_path_invalid() {
fn parse_derivation_path_invalid_format() {
assert!(matches!(
"n/0'/0".parse::<DerivationPath>(),
Err(ParseChildNumberError::ParseInt(..)),
@ -1115,6 +1115,10 @@ mod tests {
"0h/0x".parse::<DerivationPath>(),
Err(ParseChildNumberError::ParseInt(..)),
));
}
#[test]
fn parse_derivation_path_out_of_range() {
assert_eq!(
"2147483648".parse::<DerivationPath>(),
Err(ParseChildNumberError::IndexOutOfRange(IndexOutOfRangeError { index: 2147483648 })),