Skip to content

Commit

Permalink
test: Add test case (currently fails)
Browse files Browse the repository at this point in the history
  • Loading branch information
Apricot-S committed Sep 23, 2024
1 parent bf581fd commit d0989c1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,32 @@ mod tests {
assert_eq!(replacement_number, 2);
}

#[test]
fn calculate_replacement_number_2_isolated_4_tiles_4() {
let bingpai: Bingpai = [
4, 1, 0, 1, 0, 0, 0, 0, 0, // m
0, 0, 0, 0, 0, 0, 0, 0, 0, // p
0, 0, 0, 0, 0, 0, 0, 0, 0, // s
4, 0, 0, 0, 0, 0, 0, // z
];
let num_bingpai: u8 = bingpai.iter().sum();
let replacement_number = calculate_replacement_number(bingpai, &None, num_bingpai);
assert_eq!(replacement_number, 2);
}

#[test]
fn calculate_replacement_number_2_isolated_4_tiles_5() {
let bingpai: Bingpai = [
4, 0, 0, 4, 0, 0, 1, 1, 0, // m
0, 0, 0, 0, 0, 0, 0, 0, 0, // p
0, 0, 0, 0, 0, 0, 0, 0, 0, // s
0, 0, 0, 0, 0, 0, 0, // z
];
let num_bingpai: u8 = bingpai.iter().sum();
let replacement_number = calculate_replacement_number(bingpai, &None, num_bingpai);
assert_eq!(replacement_number, 3);
}

#[test]
fn calculate_replacement_number_3_isolated_4_tiles() {
let bingpai: Bingpai = [
Expand Down

0 comments on commit d0989c1

Please sign in to comment.