added frame and tests for function: bitboard::util::notation_from_square_number

This commit is contained in:
Varga Dávid Lajos
2025-11-11 13:59:53 +01:00
parent f8894bbdff
commit 092ed19104

View File

@@ -7,6 +7,10 @@ pub fn pop_msb(value: &mut u64) -> usize {
return 0;
}
pub fn notation_from_square_number(sq: u8) -> String {
return String::new();
}
// <----- TESTS ----->
@@ -54,4 +58,26 @@ mod tests {
assert_eq!(pop_lsb(&mut test_value), expected_values[index])
}
}
#[test]
fn notation_from_square_number_test() {
// test setup
let square_indices: [u8; 8] = [1, 12, 22, 27, 32, 47, 53, 58];
let notations: [String; 8] = [
String::from("b1"),
String::from("e2"),
String::from("g3"),
String::from("d4"),
String::from("a5"),
String::from("h6"),
String::from("f7"),
String::from("c8")
];
// tests
for index in 0..8 {
let notation = notation_from_square_number(square_indices[index].clone());
assert_eq!(notation, notations[index]);
}
}
}