Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests #982

Merged
merged 4 commits into from
Jun 21, 2024
Merged

Add more tests #982

merged 4 commits into from
Jun 21, 2024

Conversation

AttackingOrDefending
Copy link
Member

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

Add some tests for external moves. A lot more should be added before #920 can be closed.
Also fixes a bug in engine_wrapper found while creating these tests.

Related Issues:

#920

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

Comment on lines -1071 to +1079
best_wdl = name_to_wld[data["moves"][0]["category"]]
best_wdl = name_to_wld[data["moves"][0]["category"]] * -1

def good_enough(possible_move: LichessEGTBMoveType) -> bool:
return name_to_wld[possible_move["category"]] == best_wdl
return name_to_wld[possible_move["category"]] * -1 == best_wdl

possible_moves = list(filter(good_enough, data["moves"]))
if len(possible_moves) > 1:
move_list = [move["uci"] for move in possible_moves]
wdl = best_wdl * -1
wdl = best_wdl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I wrong, or do these code changes result in no change in behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't change anything. I just though that the code would be easier to understand because the correct wdl is with the * -1, but we can obviously test with the wrong wdl and correct it at the end as we are currently doing. The bug was in line 1105.

@MarkZH MarkZH merged commit e3fd42a into lichess-bot-devs:master Jun 21, 2024
15 checks passed
@AttackingOrDefending AttackingOrDefending deleted the online branch June 21, 2024 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants