minesweeper: format, with skips
-
-
use minesweeper::annotate;
fn remove_annotations(board: &[&str]) -> Vec<String> {
@@ -7,10 +5,12 @@ fn remove_annotations(board: &[&str]) -> Vec<String> {
}
fn remove_annotations_in_row(row: &str) -> String {
- row.chars().map(|ch| match ch {
+ row.chars()
+ .map(|ch| match ch {
'*' => '*',
- _ => ' '
- }).collect()
+ _ => ' ',
+ })
+ .collect()
}
fn run_test(test_case: &[&str]) {
@@ -22,6 +22,7 @@ fn run_test(test_case: &[&str]) {
#[test]
fn no_rows() {
+ #[rustfmt::skip]
run_test(&[
]);
}
@@ -29,6 +30,7 @@ fn no_rows() {
#[test]
#[ignore]
fn no_columns() {
+ #[rustfmt::skip]
run_test(&[
"",
]);
@@ -37,6 +39,7 @@ fn no_columns() {
#[test]
#[ignore]
fn no_mines() {
+ #[rustfmt::skip]
run_test(&[
" ",
" ",
@@ -47,6 +50,7 @@ fn no_mines() {
#[test]
#[ignore]
fn board_with_only_mines() {
+ #[rustfmt::skip]
run_test(&[
"***",
"***",
@@ -57,6 +61,7 @@ fn board_with_only_mines() {
#[test]
#[ignore]
fn mine_surrounded_by_spaces() {
+ #[rustfmt::skip]
run_test(&[
"111",
"1*1",
@@ -67,6 +72,7 @@ fn mine_surrounded_by_spaces() {
#[test]
#[ignore]
fn space_surrounded_by_mines() {
+ #[rustfmt::skip]
run_test(&[
"***",
"*8*",
@@ -77,6 +83,7 @@ fn space_surrounded_by_mines() {
#[test]
#[ignore]
fn horizontal_line() {
+ #[rustfmt::skip]
run_test(&[
"1*2*1",
]);
@@ -85,6 +92,7 @@ fn horizontal_line() {
#[test]
#[ignore]
fn horizontal_line_mines_at_edges() {
+ #[rustfmt::skip]
run_test(&[
"*1 1*",
]);
@@ -93,6 +101,7 @@ fn horizontal_line_mines_at_edges() {
#[test]
#[ignore]
fn vertical_line() {
+ #[rustfmt::skip]
run_test(&[
"1",
"*",
@@ -105,6 +114,7 @@ fn vertical_line() {
#[test]
#[ignore]
fn vertical_line_mines_at_edges() {
+ #[rustfmt::skip]
run_test(&[
"*",
"1",
@@ -117,6 +127,7 @@ fn vertical_line_mines_at_edges() {
#[test]
#[ignore]
fn cross() {
+ #[rustfmt::skip]
run_test(&[
" 2*2 ",
"25*52",
@@ -129,6 +140,7 @@ fn cross() {
#[test]
#[ignore]
fn large_board() {
+ #[rustfmt::skip]
run_test(&[
"1*22*1",
"12*322",
