Skip to content

Commit 1914977

Browse files
committed
minesweeper: format, with skips
1 parent 8a5d2bf commit 1914977

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

exercises/minesweeper/tests/minesweeper.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
2-
31
use minesweeper::annotate;
42

53
fn remove_annotations(board: &[&str]) -> Vec<String> {
64
board.iter().map(|r| remove_annotations_in_row(r)).collect()
75
}
86

97
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()
1414
}
1515

1616
fn run_test(test_case: &[&str]) {
@@ -22,13 +22,15 @@ fn run_test(test_case: &[&str]) {
2222

2323
#[test]
2424
fn no_rows() {
25+
#[rustfmt::skip]
2526
run_test(&[
2627
]);
2728
}
2829

2930
#[test]
3031
#[ignore]
3132
fn no_columns() {
33+
#[rustfmt::skip]
3234
run_test(&[
3335
"",
3436
]);
@@ -37,6 +39,7 @@ fn no_columns() {
3739
#[test]
3840
#[ignore]
3941
fn no_mines() {
42+
#[rustfmt::skip]
4043
run_test(&[
4144
" ",
4245
" ",
@@ -47,6 +50,7 @@ fn no_mines() {
4750
#[test]
4851
#[ignore]
4952
fn board_with_only_mines() {
53+
#[rustfmt::skip]
5054
run_test(&[
5155
"***",
5256
"***",
@@ -57,6 +61,7 @@ fn board_with_only_mines() {
5761
#[test]
5862
#[ignore]
5963
fn mine_surrounded_by_spaces() {
64+
#[rustfmt::skip]
6065
run_test(&[
6166
"111",
6267
"1*1",
@@ -67,6 +72,7 @@ fn mine_surrounded_by_spaces() {
6772
#[test]
6873
#[ignore]
6974
fn space_surrounded_by_mines() {
75+
#[rustfmt::skip]
7076
run_test(&[
7177
"***",
7278
"*8*",
@@ -77,6 +83,7 @@ fn space_surrounded_by_mines() {
7783
#[test]
7884
#[ignore]
7985
fn horizontal_line() {
86+
#[rustfmt::skip]
8087
run_test(&[
8188
"1*2*1",
8289
]);
@@ -85,6 +92,7 @@ fn horizontal_line() {
8592
#[test]
8693
#[ignore]
8794
fn horizontal_line_mines_at_edges() {
95+
#[rustfmt::skip]
8896
run_test(&[
8997
"*1 1*",
9098
]);
@@ -93,6 +101,7 @@ fn horizontal_line_mines_at_edges() {
93101
#[test]
94102
#[ignore]
95103
fn vertical_line() {
104+
#[rustfmt::skip]
96105
run_test(&[
97106
"1",
98107
"*",
@@ -105,6 +114,7 @@ fn vertical_line() {
105114
#[test]
106115
#[ignore]
107116
fn vertical_line_mines_at_edges() {
117+
#[rustfmt::skip]
108118
run_test(&[
109119
"*",
110120
"1",
@@ -117,6 +127,7 @@ fn vertical_line_mines_at_edges() {
117127
#[test]
118128
#[ignore]
119129
fn cross() {
130+
#[rustfmt::skip]
120131
run_test(&[
121132
" 2*2 ",
122133
"25*52",
@@ -129,6 +140,7 @@ fn cross() {
129140
#[test]
130141
#[ignore]
131142
fn large_board() {
143+
#[rustfmt::skip]
132144
run_test(&[
133145
"1*22*1",
134146
"12*322",

0 commit comments

Comments
 (0)