Skip to content

Commit

Permalink
Added a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mooskagh committed Oct 26, 2024
1 parent 4549a1d commit f1676d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3508,14 +3508,15 @@ def test_uci_info(self):
self.assertEqual(info["seldepth"], 8)
self.assertEqual(info["score"], chess.engine.PovScore(chess.engine.Mate(+3), chess.WHITE))

# Info: tbhits, cpuload, hashfull, time, nodes, nps.
info = chess.engine._parse_uci_info("tbhits 123 cpuload 456 hashfull 789 time 987 nodes 654 nps 321", board)
# Info: tbhits, cpuload, hashfull, time, nodes, nps, movesleft.
info = chess.engine._parse_uci_info("tbhits 123 cpuload 456 hashfull 789 movesleft 42 time 987 nodes 654 nps 321", board)
self.assertEqual(info["tbhits"], 123)
self.assertEqual(info["cpuload"], 456)
self.assertEqual(info["hashfull"], 789)
self.assertEqual(info["time"], 0.987)
self.assertEqual(info["nodes"], 654)
self.assertEqual(info["nps"], 321)
self.assertEqual(info["movesleft"], 42)

# Hakkapeliitta double spaces.
info = chess.engine._parse_uci_info("depth 10 seldepth 9 score cp 22 time 17 nodes 48299 nps 2683000 tbhits 0", board)
Expand Down

0 comments on commit f1676d5

Please sign in to comment.