Files
swift-chess/Tests/EngineTests/EngineTests.swift
2024-06-26 01:07:03 +02:00

27 lines
520 B
Swift

import XCTest
@testable import Engine
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()
// }
override func tearDown() {
super.tearDown()
}
}