@@ -4474,12 +4474,15 @@ async def main():
44744474 mock .expect ("ucinewgame" )
44754475 mock .expect ("isready" , ["readyok" ])
44764476 mock .expect ("position startpos" )
4477- mock .expect ("go depth 5" , [
4478- "info depth 5 score cp 30 lowerbound pv e2e4" ,
4479- "info depth 5 score cp 20 upperbound pv e2e4" ,
4480- "info depth 5 score cp 25 pv e2e4" ,
4481- "bestmove e2e4" ,
4482- ])
4477+ mock .expect (
4478+ "go depth 5" ,
4479+ [
4480+ "info depth 5 score cp 30 lowerbound pv e2e4" ,
4481+ "info depth 5 score cp 20 upperbound pv e2e4" ,
4482+ "info depth 5 score cp 25 pv e2e4" ,
4483+ "bestmove e2e4" ,
4484+ ],
4485+ )
44834486 info = await protocol .analyse (board , chess .engine .Limit (depth = 5 ))
44844487 self .assertEqual (info ["score" ], chess .engine .PovScore (chess .engine .Cp (25 ), chess .WHITE ))
44854488 self .assertNotIn ("lowerbound" , info )
@@ -4488,11 +4491,14 @@ async def main():
44884491
44894492 # Non-score info lines should preserve the current bound flag.
44904493 mock .expect ("position startpos" )
4491- mock .expect ("go depth 6" , [
4492- "info depth 6 score cp 40 lowerbound pv d2d4" ,
4493- "info currmove d2d4" ,
4494- "bestmove d2d4" ,
4495- ])
4494+ mock .expect (
4495+ "go depth 6" ,
4496+ [
4497+ "info depth 6 score cp 40 lowerbound pv d2d4" ,
4498+ "info currmove d2d4" ,
4499+ "bestmove d2d4" ,
4500+ ],
4501+ )
44964502 info = await protocol .analyse (board , chess .engine .Limit (depth = 6 ))
44974503 self .assertEqual (info ["score" ], chess .engine .PovScore (chess .engine .Cp (40 ), chess .WHITE ))
44984504 self .assertTrue (info .get ("lowerbound" ))
@@ -4502,12 +4508,15 @@ async def main():
45024508 # Bound flags are cleared per-multipv line independently.
45034509 mock .expect ("setoption name MultiPV value 2" )
45044510 mock .expect ("position startpos" )
4505- mock .expect ("go depth 5" , [
4506- "info depth 5 multipv 1 score cp 30 lowerbound pv e2e4" ,
4507- "info depth 5 multipv 2 score cp 10 upperbound pv d2d4" ,
4508- "info depth 5 multipv 1 score cp 25 pv e2e4" ,
4509- "bestmove e2e4" ,
4510- ])
4511+ mock .expect (
4512+ "go depth 5" ,
4513+ [
4514+ "info depth 5 multipv 1 score cp 30 lowerbound pv e2e4" ,
4515+ "info depth 5 multipv 2 score cp 10 upperbound pv d2d4" ,
4516+ "info depth 5 multipv 1 score cp 25 pv e2e4" ,
4517+ "bestmove e2e4" ,
4518+ ],
4519+ )
45114520 infos = await protocol .analyse (board , chess .engine .Limit (depth = 5 ), multipv = 2 )
45124521 self .assertEqual (infos [0 ]["score" ], chess .engine .PovScore (chess .engine .Cp (25 ), chess .WHITE ))
45134522 self .assertNotIn ("lowerbound" , infos [0 ])
@@ -4517,6 +4526,22 @@ async def main():
45174526 self .assertNotIn ("lowerbound" , infos [1 ])
45184527 mock .assert_done ()
45194528
4529+ # Same for info aggregated by play().
4530+ mock .expect ("setoption name MultiPV value 1" )
4531+ mock .expect ("position startpos" )
4532+ mock .expect (
4533+ "go depth 5" ,
4534+ [
4535+ "info depth 5 score cp 30 lowerbound pv e2e4" ,
4536+ "info depth 5 score cp 25 pv e2e4" ,
4537+ "bestmove e2e4" ,
4538+ ],
4539+ )
4540+ result = await protocol .play (board , chess .engine .Limit (depth = 5 ), info = chess .engine .INFO_ALL )
4541+ self .assertEqual (result .info ["score" ], chess .engine .PovScore (chess .engine .Cp (25 ), chess .WHITE ))
4542+ self .assertNotIn ("lowerbound" , result .info )
4543+ mock .assert_done ()
4544+
45204545 asyncio .run (main ())
45214546
45224547 def test_uci_result (self ):
0 commit comments