1
-
2
-
3
1
use minesweeper:: annotate;
4
2
5
3
fn remove_annotations ( board : & [ & str ] ) -> Vec < String > {
6
4
board. iter ( ) . map ( |r| remove_annotations_in_row ( r) ) . collect ( )
7
5
}
8
6
9
7
fn remove_annotations_in_row ( row : & str ) -> String {
10
- row. chars ( ) . map ( |ch| match ch {
11
- '*' => '*' ,
12
- _ => ' '
13
- } ) . collect ( )
8
+ row. chars ( )
9
+ . map ( |ch| match ch {
10
+ '*' => '*' ,
11
+ _ => ' ' ,
12
+ } )
13
+ . collect ( )
14
14
}
15
15
16
16
fn run_test ( test_case : & [ & str ] ) {
@@ -22,13 +22,15 @@ fn run_test(test_case: &[&str]) {
22
22
23
23
#[ test]
24
24
fn no_rows ( ) {
25
+ #[ rustfmt:: skip]
25
26
run_test ( & [
26
27
] ) ;
27
28
}
28
29
29
30
#[ test]
30
31
#[ ignore]
31
32
fn no_columns ( ) {
33
+ #[ rustfmt:: skip]
32
34
run_test ( & [
33
35
"" ,
34
36
] ) ;
@@ -37,6 +39,7 @@ fn no_columns() {
37
39
#[ test]
38
40
#[ ignore]
39
41
fn no_mines ( ) {
42
+ #[ rustfmt:: skip]
40
43
run_test ( & [
41
44
" " ,
42
45
" " ,
@@ -47,6 +50,7 @@ fn no_mines() {
47
50
#[ test]
48
51
#[ ignore]
49
52
fn board_with_only_mines ( ) {
53
+ #[ rustfmt:: skip]
50
54
run_test ( & [
51
55
"***" ,
52
56
"***" ,
@@ -57,6 +61,7 @@ fn board_with_only_mines() {
57
61
#[ test]
58
62
#[ ignore]
59
63
fn mine_surrounded_by_spaces ( ) {
64
+ #[ rustfmt:: skip]
60
65
run_test ( & [
61
66
"111" ,
62
67
"1*1" ,
@@ -67,6 +72,7 @@ fn mine_surrounded_by_spaces() {
67
72
#[ test]
68
73
#[ ignore]
69
74
fn space_surrounded_by_mines ( ) {
75
+ #[ rustfmt:: skip]
70
76
run_test ( & [
71
77
"***" ,
72
78
"*8*" ,
@@ -77,6 +83,7 @@ fn space_surrounded_by_mines() {
77
83
#[ test]
78
84
#[ ignore]
79
85
fn horizontal_line ( ) {
86
+ #[ rustfmt:: skip]
80
87
run_test ( & [
81
88
"1*2*1" ,
82
89
] ) ;
@@ -85,6 +92,7 @@ fn horizontal_line() {
85
92
#[ test]
86
93
#[ ignore]
87
94
fn horizontal_line_mines_at_edges ( ) {
95
+ #[ rustfmt:: skip]
88
96
run_test ( & [
89
97
"*1 1*" ,
90
98
] ) ;
@@ -93,6 +101,7 @@ fn horizontal_line_mines_at_edges() {
93
101
#[ test]
94
102
#[ ignore]
95
103
fn vertical_line ( ) {
104
+ #[ rustfmt:: skip]
96
105
run_test ( & [
97
106
"1" ,
98
107
"*" ,
@@ -105,6 +114,7 @@ fn vertical_line() {
105
114
#[ test]
106
115
#[ ignore]
107
116
fn vertical_line_mines_at_edges ( ) {
117
+ #[ rustfmt:: skip]
108
118
run_test ( & [
109
119
"*" ,
110
120
"1" ,
@@ -117,6 +127,7 @@ fn vertical_line_mines_at_edges() {
117
127
#[ test]
118
128
#[ ignore]
119
129
fn cross ( ) {
130
+ #[ rustfmt:: skip]
120
131
run_test ( & [
121
132
" 2*2 " ,
122
133
"25*52" ,
@@ -129,6 +140,7 @@ fn cross() {
129
140
#[ test]
130
141
#[ ignore]
131
142
fn large_board ( ) {
143
+ #[ rustfmt:: skip]
132
144
run_test ( & [
133
145
"1*22*1" ,
134
146
"12*322" ,
0 commit comments