Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererXII committed May 29, 2024
1 parent 21ad5ab commit 898a8f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/variant/chushogi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ test('lion moves', () => {
const pos4 = parseSfen('chushogi', '11k/12/12/10bm/9N2/12/5n6/6N5/5r6/12/9K2/12 b').unwrap();
pos4.play(parseUsi('6h7g')!);
expect(pos4.isLegal(parseUsi('2d3e')!)).toBe(true);

const pos5 = parseSfen('chushogi', '12/12/12/12/12/12/12/12/4+ho3n2/4N7/12/6B5 w').unwrap(),
pos5Alt = pos5.clone(),
pos5Alt2 = pos5.clone();
pos5.play(parseUsi('8i8j8i')!);
pos5Alt.play(parseUsi('8i8j')!);
pos5Alt2.play(parseUsi('7i8j+')!);
expect(pos5.isLegal(parseUsi('6l3i')!)).toBe(false);
expect(pos5Alt.isLegal(parseUsi('6l3i')!)).toBe(false);
expect(pos5Alt2.isLegal(parseUsi('6l3i')!)).toBe(false);
expect(pos5Alt2.isLegal(parseUsi('6l8j')!)).toBe(true);
});

test('wiki lion moves', () => {
Expand Down

0 comments on commit 898a8f4

Please sign in to comment.