added SEE test suite
This commit is contained in:
1 parent
e9759245b0
commit
71c3e64e3b
6 files changed
+120
-2
No files matched your search
@@ -0,0 +1,36 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cassert>
|
||||
#include "tests.h"
|
||||
#include "utils.h"
|
||||
#include "search.h"
|
||||
|
||||
namespace TEST {
|
||||
|
||||
void SEE() {
|
||||
std::ifstream file("tests/SEE.txt");
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
std::stringstream iss(line);
|
||||
std::cout << line << ' ';
|
||||
Board board;
|
||||
|
||||
std::vector tokens = UTILS::split(line, '|');
|
||||
|
||||
std::string fen = tokens[0];
|
||||
board.SetByFen(fen);
|
||||
|
||||
Move move = UTILS::parseMove(board, tokens[1]);
|
||||
|
||||
int gain = std::stoi(tokens[2]);
|
||||
|
||||
assert(SEARCH::SEE(board, move, gain - 1));
|
||||
assert(SEARCH::SEE(board, move, gain));
|
||||
assert(!SEARCH::SEE(board, move, gain + 1));
|
||||
|
||||
std::cout << "| PASSED" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user