Bläddra i källkod

Merge branch 'hw1' of github.com:htwg-syslab-bsys-ws17/bsys-ws17-template into hw1

Joshua Rutschmann 8 år sedan
förälder
incheckning
e540c0de3d
1 ändrade filer med 23 tillägg och 11 borttagningar
  1. 23
    11
      hw1/task3/tests/task3.rs

+ 23
- 11
hw1/task3/tests/task3.rs Visa fil

2
 
2
 
3
 #[test]
3
 #[test]
4
 fn test_one_char() {
4
 fn test_one_char() {
5
-    assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'T'),
6
-               1);
5
+    assert_eq!(
6
+        task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'T'),
7
+        1
8
+    );
7
 }
9
 }
8
 
10
 
9
 #[test]
11
 #[test]
10
 fn test_two_char() {
12
 fn test_two_char() {
11
-    assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥",
12
-                     '♥'),
13
-               2);
13
+    assert_eq!(
14
+        task3::count(
15
+            "♥ The quick brown fox jumps over the lazy dog. ♥",
16
+            '♥',
17
+        ),
18
+        2
19
+    );
14
 }
20
 }
15
 
21
 
16
 #[test]
22
 #[test]
17
 #[should_panic]
23
 #[should_panic]
18
 fn test_wrong() {
24
 fn test_wrong() {
19
-    assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'c'),
20
-               2);
25
+    assert_eq!(
26
+        task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'c'),
27
+        2
28
+    );
21
 }
29
 }
22
 
30
 
23
 #[test]
31
 #[test]
24
 fn test_four_char() {
32
 fn test_four_char() {
25
-    assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'o'),
26
-               4);
33
+    assert_eq!(
34
+        task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'o'),
35
+        4
36
+    );
27
 }
37
 }
28
 
38
 
29
 #[test]
39
 #[test]
30
 fn test_no_char() {
40
 fn test_no_char() {
31
-    assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", '!'),
32
-               0);
41
+    assert_eq!(
42
+        task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", '!'),
43
+        0
44
+    );
33
 }
45
 }

Laddar…
Avbryt
Spara