|
|
@@ -2,34 +2,6 @@
|
|
2
|
2
|
mod tests {
|
|
3
|
3
|
use ::*;
|
|
4
|
4
|
|
|
5
|
|
-
|
|
6
|
|
- #[test]
|
|
7
|
|
- fn test_multithreaded_search() {
|
|
8
|
|
- assert_eq!(
|
|
9
|
|
- search_with_threads(4, String::from("12345"), 42, false, 0, None, false),
|
|
10
|
|
- Some(Solution {
|
|
11
|
|
- number: 567621,
|
|
12
|
|
- hash: String::from(
|
|
13
|
|
- "b6bea2a40ed1bd6d9999b2232072092f3df0e02c4b507aa3ad947367b9712345",
|
|
14
|
|
- ),
|
|
15
|
|
- })
|
|
16
|
|
- )
|
|
17
|
|
- }
|
|
18
|
|
-
|
|
19
|
|
- #[test]
|
|
20
|
|
- fn test_correct_diff() {
|
|
21
|
|
- let hash = String::from(
|
|
22
|
|
- "b6bea2a40ed1bd6d9999b2232072092f3df0e02c4b507aa3ad947367b9712345",
|
|
23
|
|
- );
|
|
24
|
|
- assert_eq!(
|
|
25
|
|
- verify_product(42, 567621, &String::from("12345")),
|
|
26
|
|
- Some(Solution {
|
|
27
|
|
- number: 567621,
|
|
28
|
|
- hash: hash,
|
|
29
|
|
- })
|
|
30
|
|
- )
|
|
31
|
|
- }
|
|
32
|
|
-
|
|
33
|
5
|
#[test]
|
|
34
|
6
|
fn test_wrong_diff() {
|
|
35
|
7
|
assert_eq!(verify_product(42, 13253224, &String::from("12345")), None)
|