Browse Source

Fixed wrong test. Now everything is fine.

Joshua Rutschmann 8 years ago
parent
commit
6ac4706d88
2 changed files with 1 additions and 7 deletions
  1. 0
    3
      hw5/task1/src/child/mod.rs
  2. 1
    4
      hw5/task1/src/unit_tests.rs

+ 0
- 3
hw5/task1/src/child/mod.rs View File

15
 
15
 
16
             if value > 0 {
16
             if value > 0 {
17
                 fork_children(0, value - 1, start_pid);
17
                 fork_children(0, value - 1, start_pid);
18
-            } else {
19
-                return Err("Number of forks must not be zero.".to_string());
20
             }
18
             }
21
-
22
             Ok(())
19
             Ok(())
23
         }
20
         }
24
         Err(_) => {
21
         Err(_) => {

+ 1
- 4
hw5/task1/src/unit_tests.rs View File

6
 
6
 
7
     #[test]
7
     #[test]
8
     fn test_zero_forks() {
8
     fn test_zero_forks() {
9
-        assert_eq!(
10
-            run_childs(123, "0"),
11
-            Err("Number of forks must not be zero.".to_string())
12
-        )
9
+        assert_eq!(run_childs(123, "0"), Ok(()))
13
     }
10
     }
14
 
11
 
15
     #[test]
12
     #[test]

Loading…
Cancel
Save