Skip to content

Commit a828af6

Browse files
committed
Test cases for display_secret
1 parent 8966783 commit a828af6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/secret.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,24 @@ impl KeyPair {
119119
}
120120
}
121121
*/
122+
123+
#[cfg(test)]
124+
mod test {
125+
use key::ONE_KEY;
126+
127+
#[test]
128+
pub fn secret_key_display() {
129+
assert_eq!(
130+
ONE_KEY.display_secret().to_string(),
131+
"0000000000000000000000000000000000000000000000000000000000000001"
132+
);
133+
}
134+
135+
#[test]
136+
pub fn secret_key_debug() {
137+
assert_eq!(
138+
&format!("{:?}", ONE_KEY.display_secret()),
139+
"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]"
140+
);
141+
}
142+
}

0 commit comments

Comments
 (0)