public void testPawnMoves() throws ChessParseError {
  String fen="1r2k3/P1pppp2/8/1pP3p1/1nPp2P1/n4p1P/1P2PP2/4KBNR w K b6 0 1";
  Position pos=TextIO.readFEN(fen);
  assertEquals(fen,TextIO.toFEN(pos));
  List<String> strMoves=getMoveList(pos,false);
  assertTrue(strMoves.contains("c5xb6"));
  assertTrue(strMoves.contains("a7-a8Q"));
  assertTrue(strMoves.contains("a7-a8N"));
  assertTrue(strMoves.contains("a7xb8R#"));
  assertTrue(strMoves.contains("b2-b3"));
  assertTrue(strMoves.contains("b2xa3"));
  assertTrue(strMoves.contains("e2-e4"));
  assertTrue(strMoves.contains("e2xf3"));
  assertEquals(22,strMoves.size());
  pos.setEpSquare(-1);
  strMoves=getMoveList(pos,false);
  assertEquals(21,strMoves.size());
  pos.setWhiteMove(false);
  strMoves=getMoveList(pos,false);
  assertTrue(strMoves.contains("f3xe2"));
  assertTrue(strMoves.contains("d4-d3"));
  assertTrue(strMoves.contains("e7-e6"));
  assertTrue(strMoves.contains("e7-e5"));
  assertEquals(26,strMoves.size());
  pos.setPiece(Position.getSquare(0,1),Piece.BPAWN);
  strMoves=getMoveList(pos,false);
  assertTrue(strMoves.contains("a2-a1Q+"));
  assertTrue(strMoves.contains("a2-a1R+"));
  assertTrue(strMoves.contains("a2-a1N"));
  assertTrue(strMoves.contains("a2-a1B"));
}

public void testPawnMoves ( ) throws ChessParseError { String fen = "1r2k3/P1pppp2/8/1pP3p1/1nPp2P1/n4p1P/1P2PP2/4KBNR w K b6 0 1" ; Position pos = TextIO . readFEN ( fen ) ; assertEquals ( fen , TextIO . toFEN ( pos ) ) ; List < String > strMoves = getMoveList ( pos , false ) ; assertTrue ( strMoves . contains ( "c5xb6" ) ) ; assertTrue ( strMoves . contains ( "a7-a8Q" ) ) ; assertTrue ( strMoves . contains ( "a7-a8N" ) ) ; assertTrue ( strMoves . contains ( "a7xb8R#" ) ) ; assertTrue ( strMoves . contains ( "b2-b3" ) ) ; assertTrue ( strMoves . contains ( "b2xa3" ) ) ; assertTrue ( strMoves . contains ( "e2-e4" ) ) ; assertTrue ( strMoves . contains ( "e2xf3" ) ) ; assertEquals ( 22 , strMoves . size ( ) ) ; pos . setEpSquare ( - 1 ) ; strMoves = getMoveList ( pos , false ) ; assertEquals ( 21 , strMoves . size ( ) ) ; pos . setWhiteMove ( false ) ; strMoves = getMoveList ( pos , false ) ; assertTrue ( strMoves . contains ( "f3xe2" ) ) ; assertTrue ( strMoves . contains ( "d4-d3" ) ) ; assertTrue ( strMoves . contains ( "e7-e6" ) ) ; assertTrue ( strMoves . contains ( "e7-e5" ) ) ; assertEquals ( 26 , strMoves . size ( ) ) ; pos . setPiece ( Position . getSquare ( 0 , 1 ) , Piece . BPAWN ) ; strMoves = getMoveList ( pos , false ) ; assertTrue ( strMoves . contains ( "a2-a1Q+" ) ) ; assertTrue ( strMoves . contains ( "a2-a1R+" ) ) ; assertTrue ( strMoves . contains ( "a2-a1N" ) ) ; assertTrue ( strMoves . contains ( "a2-a1B" ) ) ; }
test of pseudolegalmoves method , of class movegen . pawn moves .
