tanliyon / gym-xiangqi

This repo sets up the environment to play Xiang Qi (chinese chess) following the OpenAI Gym framework.
GNU Lesser General Public License v3.0
32 stars 6 forks source link

Add unit test for general and advisor #17

Closed tanliyon closed 3 years ago

tanliyon commented 3 years ago

Description

This PR adds unit tests for the following pieces:

  1. General
  2. Advisor

While writing unit tests, the following bugs were found and fixed:

  1. Typo in DIAGONAL constant, where there are 2 (-1, 1).
  2. env.possible_actions needs to be cleared when calling get_possible_actions(). This is to remove the actions generated from the previous move. Clearing might not be ideal since it is very expensive, so I've added a TODO for a future PR.

The unit tests for other pieces will be in a separate PR to make each PR small and manageable.

Type of change

How has this been tested?

CI