Created
January 3, 2021 13:41
-
-
Save zzuummaa/09c6a481ec0e67dda6f1be3578b7b4c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_borrowing_rules_bad() { | |
let mut board = ByteBoard::empty(); | |
*board.cell_mut(1, 1) = Figure::new(PAWN, WHITE); | |
let mut score_estimator = ScoreEstimator::new(&board); | |
unsafe { | |
assert_eq!((*score_estimator.white_list.first).point, Point::new(1, 1)); | |
} | |
let mut move_list = MoveList::default(); | |
unsafe { | |
assert_eq!((*score_estimator.white_list.first).point, Point::new(1, 1)); | |
} | |
} | |
#[test] | |
fn test_borrowing_rules_good() { | |
let mut board = ByteBoard::empty(); | |
*board.cell_mut(1, 1) = Figure::new(PAWN, WHITE); | |
let mut figure_list = FigureList::new(&board, WHITE); | |
unsafe { | |
assert_eq!((*figure_list.first).point, Point::new(1, 1)); | |
} | |
let mut move_list = MoveList::default(); | |
unsafe { | |
assert_eq!((*figure_list.first).point, Point::new(1, 1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment