full codecov
This commit is contained in:
parent
8a61a3aedc
commit
e64128fbf1
|
@ -1 +1,2 @@
|
||||||
/target
|
/target
|
||||||
|
tarpaulin-report.html
|
14
src/board.rs
14
src/board.rs
|
@ -121,6 +121,20 @@ mod tests {
|
||||||
use crate::board::{Boardfield, BoardfieldOps};
|
use crate::board::{Boardfield, BoardfieldOps};
|
||||||
use crate::piece::{PieceColor, PieceType};
|
use crate::piece::{PieceColor, PieceType};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[should_panic]
|
||||||
|
fn get_out_of_bounds() {
|
||||||
|
let field = Boardfield::startpos();
|
||||||
|
field.get_pos(64);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[should_panic]
|
||||||
|
fn set_out_of_bounds() {
|
||||||
|
let mut field = Boardfield::startpos();
|
||||||
|
field.set_pos(64, 0u8);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn bitfield_board() {
|
fn bitfield_board() {
|
||||||
let field = Boardfield::startpos();
|
let field = Boardfield::startpos();
|
||||||
|
|
|
@ -4,7 +4,9 @@ use std::sync::{Arc};
|
||||||
use crate::uci::{uci_handle_command, UCIState};
|
use crate::uci::{uci_handle_command, UCIState};
|
||||||
use spin::Mutex;
|
use spin::Mutex;
|
||||||
|
|
||||||
|
#[cfg(not(tarpaulin_include))] // UCI parse engine is not tested with tarpaulin, outer test harness is planned
|
||||||
pub mod uci;
|
pub mod uci;
|
||||||
|
|
||||||
pub mod board;
|
pub mod board;
|
||||||
pub mod piece;
|
pub mod piece;
|
||||||
|
|
||||||
|
@ -12,6 +14,7 @@ pub const ENGINE_NAME: &str = "Bamboo";
|
||||||
pub const ENGINE_VERSION: &str = "1.0";
|
pub const ENGINE_VERSION: &str = "1.0";
|
||||||
pub const ENGINE_AUTHOR: &str = "c0repwn3r";
|
pub const ENGINE_AUTHOR: &str = "c0repwn3r";
|
||||||
|
|
||||||
|
#[cfg(not(tarpaulin_include))]
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("{} {} by {}", ENGINE_NAME, ENGINE_VERSION, ENGINE_AUTHOR);
|
println!("{} {} by {}", ENGINE_NAME, ENGINE_VERSION, ENGINE_AUTHOR);
|
||||||
|
|
||||||
|
|
12
src/piece.rs
12
src/piece.rs
|
@ -63,20 +63,32 @@ mod piece_tests {
|
||||||
fn piece_color_checks() {
|
fn piece_color_checks() {
|
||||||
assert!(!Piece::is_white(PieceType::Pawn as u8 | PieceColor::Black as u8));
|
assert!(!Piece::is_white(PieceType::Pawn as u8 | PieceColor::Black as u8));
|
||||||
assert!(Piece::is_white(PieceType::Pawn as u8 | PieceColor::White as u8));
|
assert!(Piece::is_white(PieceType::Pawn as u8 | PieceColor::White as u8));
|
||||||
|
assert!(Piece::is_black(PieceType::Pawn as u8 | PieceColor::Black as u8));
|
||||||
|
assert!(!Piece::is_black(PieceType::Pawn as u8 | PieceColor::White as u8));
|
||||||
|
|
||||||
assert!(!Piece::is_white(PieceType::Knight as u8 | PieceColor::Black as u8));
|
assert!(!Piece::is_white(PieceType::Knight as u8 | PieceColor::Black as u8));
|
||||||
assert!(Piece::is_white(PieceType::Knight as u8 | PieceColor::White as u8));
|
assert!(Piece::is_white(PieceType::Knight as u8 | PieceColor::White as u8));
|
||||||
|
assert!(Piece::is_black(PieceType::Knight as u8 | PieceColor::Black as u8));
|
||||||
|
assert!(!Piece::is_black(PieceType::Knight as u8 | PieceColor::White as u8));
|
||||||
|
|
||||||
assert!(!Piece::is_white(PieceType::Bishop as u8 | PieceColor::Black as u8));
|
assert!(!Piece::is_white(PieceType::Bishop as u8 | PieceColor::Black as u8));
|
||||||
assert!(Piece::is_white(PieceType::Bishop as u8 | PieceColor::White as u8));
|
assert!(Piece::is_white(PieceType::Bishop as u8 | PieceColor::White as u8));
|
||||||
|
assert!(Piece::is_black(PieceType::Bishop as u8 | PieceColor::Black as u8));
|
||||||
|
assert!(!Piece::is_black(PieceType::Bishop as u8 | PieceColor::White as u8));
|
||||||
|
|
||||||
assert!(!Piece::is_white(PieceType::Rook as u8 | PieceColor::Black as u8));
|
assert!(!Piece::is_white(PieceType::Rook as u8 | PieceColor::Black as u8));
|
||||||
assert!(Piece::is_white(PieceType::Rook as u8 | PieceColor::White as u8));
|
assert!(Piece::is_white(PieceType::Rook as u8 | PieceColor::White as u8));
|
||||||
|
assert!(Piece::is_black(PieceType::Rook as u8 | PieceColor::Black as u8));
|
||||||
|
assert!(!Piece::is_black(PieceType::Rook as u8 | PieceColor::White as u8));
|
||||||
|
|
||||||
assert!(!Piece::is_white(PieceType::Queen as u8 | PieceColor::Black as u8));
|
assert!(!Piece::is_white(PieceType::Queen as u8 | PieceColor::Black as u8));
|
||||||
assert!(Piece::is_white(PieceType::Queen as u8 | PieceColor::White as u8));
|
assert!(Piece::is_white(PieceType::Queen as u8 | PieceColor::White as u8));
|
||||||
|
assert!(Piece::is_black(PieceType::Queen as u8 | PieceColor::Black as u8));
|
||||||
|
assert!(!Piece::is_black(PieceType::Queen as u8 | PieceColor::White as u8));
|
||||||
|
|
||||||
assert!(!Piece::is_white(PieceType::King as u8 | PieceColor::Black as u8));
|
assert!(!Piece::is_white(PieceType::King as u8 | PieceColor::Black as u8));
|
||||||
assert!(Piece::is_white(PieceType::King as u8 | PieceColor::White as u8));
|
assert!(Piece::is_white(PieceType::King as u8 | PieceColor::White as u8));
|
||||||
|
assert!(Piece::is_black(PieceType::King as u8 | PieceColor::Black as u8));
|
||||||
|
assert!(!Piece::is_black(PieceType::King as u8 | PieceColor::White as u8));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue