<commit_before>package li.seiji.minichess;

import li.seiji.minichess.move.Move;
import org.junit.Test;

import java.util.HashSet;

import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;

public class MoveTest {

    @Test
    public void testMoveStringParsing() {
        Move move = new Move("c2-e4");
        assertSquareCorrect(move.from, 2, 1);
        assertSquareCorrect(move.to, 4, 3);

        move = new Move("e4-c2");
        assertSquareCorrect(move.from, 4, 3);
        assertSquareCorrect(move.to, 2, 1);
    }


    @Test
    public void testHashAndEquality() {
        HashSet<Move> moves = new HashSet<>();
        for(int y = 0; y < 250; ++y) {
            for(int x = 0; x < 250; ++x) {
                moves.add(new Move(new Square(x, y), new Square(250-x, 250-y)));
            }
        }

        //test that the HashSet can find them
        for(Move move : moves) {
            assertTrue(moves.contains(move));
        }
    }


    private static void assertSquareCorrect(Square square, int x, int y) {
        assertEquals(x, square.x);
        assertEquals(y, square.y);
    }

}
<commit_msg>Fix Move parsing test<commit_after>package li.seiji.minichess;

import li.seiji.minichess.move.Move;
import org.junit.Test;

import java.util.HashSet;

import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;

public class MoveTest {

    @Test
    public void testMoveStringParsing() {
        for(int y = 0; y < 250; ++y) {
            for(int x = 0; x < 250; ++x) {
                Move move = new Move(new Square(x, y), new Square(250-x, 250-y));
                Move parsedMove = new Move(move.toString());
                assertEquals(move.toString(), parsedMove.toString());
            }
        }
    }


    @Test
    public void testHashAndEquality() {
        HashSet<Move> moves = new HashSet<>();
        for(int y = 0; y < 250; ++y) {
            for(int x = 0; x < 250; ++x) {
                moves.add(new Move(new Square(x, y), new Square(250-x, 250-y)));
            }
        }

        //test that the HashSet can find them
        for(Move move : moves) {
            assertTrue(moves.contains(move));
        }
    }


    private static void assertSquareCorrect(Square square, int x, int y) {
        assertEquals(x, square.x);
        assertEquals(y, square.y);
    }

}

{'fraction_non_alphanumeric': 0.12681309573145463, 'fraction_numerical': 0.02237878159966846, 'mean_word_length': 2.1763157894736844, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6068013', 'n_tokens_mistral': 821, 'n_tokens_neox': 754, 'n_words': 193}