Test + bug fixes
This commit is contained in:
@@ -6,6 +6,17 @@ final class EngineTests: XCTestCase {
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
}
|
||||
func testPositionIndex() throws {
|
||||
var rank = 9
|
||||
for i in 0..<64 {
|
||||
let file = (i % 8) + 1
|
||||
if file - 1 == 0 {
|
||||
rank -= 1
|
||||
}
|
||||
let pos: Square.Position = .init(file: UInt8(file), rank: UInt8(rank))
|
||||
XCTAssertTrue(pos.index == i, "Expected \(i) got \(pos.index)")
|
||||
}
|
||||
}
|
||||
// func testBoard() throws {
|
||||
// let board = Board()
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user