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:
parent
76dd6100a2
commit
015fb1be3b
|
@ -1098,7 +1098,7 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_derivation_path_invalid() {
|
fn parse_derivation_path_invalid_format() {
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
"n/0'/0".parse::<DerivationPath>(),
|
"n/0'/0".parse::<DerivationPath>(),
|
||||||
Err(ParseChildNumberError::ParseInt(..)),
|
Err(ParseChildNumberError::ParseInt(..)),
|
||||||
|
@ -1115,6 +1115,10 @@ mod tests {
|
||||||
"0h/0x".parse::<DerivationPath>(),
|
"0h/0x".parse::<DerivationPath>(),
|
||||||
Err(ParseChildNumberError::ParseInt(..)),
|
Err(ParseChildNumberError::ParseInt(..)),
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_derivation_path_out_of_range() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"2147483648".parse::<DerivationPath>(),
|
"2147483648".parse::<DerivationPath>(),
|
||||||
Err(ParseChildNumberError::IndexOutOfRange(IndexOutOfRangeError { index: 2147483648 })),
|
Err(ParseChildNumberError::IndexOutOfRange(IndexOutOfRangeError { index: 2147483648 })),
|
||||||
|
|
Loading…
Reference in New Issue