fix(store): move rules (wip: failing tests)
This commit is contained in:
parent
703803e329
commit
58f83ea985
1 changed files with 29 additions and 0 deletions
|
|
@ -954,6 +954,22 @@ mod tests {
|
||||||
state.moves_allowed(&moves)
|
state.moves_allowed(&moves)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
state.board.set_positions(
|
||||||
|
&Color::White,
|
||||||
|
[
|
||||||
|
6, 0, 0, 0, 0, 0, 2, 2, 1, 2, 0, 2, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
state.dice.values = (3, 3);
|
||||||
|
let moves = (
|
||||||
|
CheckerMove::new(14, 11).unwrap(),
|
||||||
|
CheckerMove::new(14, 11).unwrap(),
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
Err(MoveError::OpponentCanFillQuarter),
|
||||||
|
state.moves_allowed(&moves)
|
||||||
|
);
|
||||||
|
|
||||||
state.board.set_positions(
|
state.board.set_positions(
|
||||||
&Color::White,
|
&Color::White,
|
||||||
[
|
[
|
||||||
|
|
@ -1261,6 +1277,19 @@ mod tests {
|
||||||
);
|
);
|
||||||
assert!(!state.moves_possible(&moves));
|
assert!(!state.moves_possible(&moves));
|
||||||
|
|
||||||
|
state.board.set_positions(
|
||||||
|
&Color::White,
|
||||||
|
[
|
||||||
|
0, 0, 0, 0, 0, 0, 6, 2, 2, 2, 2, 2, -2, -6, -1, -3, -1, 0, -2, 0, 0, 0, 0, 0,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
state.dice.values = (5, 5);
|
||||||
|
let moves = (
|
||||||
|
CheckerMove::new(10, 15).unwrap(),
|
||||||
|
CheckerMove::new(15, 20).unwrap(),
|
||||||
|
);
|
||||||
|
assert!(state.moves_possible(&moves));
|
||||||
|
|
||||||
// black moves
|
// black moves
|
||||||
let state = MoveRules::new(&Color::Black, &Board::default(), Dice::default());
|
let state = MoveRules::new(&Color::Black, &Board::default(), Dice::default());
|
||||||
let moves = (
|
let moves = (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue