<commit_before>package li.seiji.minichess;

import org.junit.Test;

import java.util.HashSet;

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

public class SquareTest {

    @Test
    public void testAutoPositionStringParsing() {
        String[][] positions = new String[Board.ROWS][Board.COLUMNS];
        for(int y = 0; y < Board.ROWS; ++y) {
            for(int x = 0; x < Board.COLUMNS; ++x) {
                char[] posStr = {
                        (char)((int)'a' + x),
                        (char)((int)'1' + y)
                }; //construct position strings like: "c4"
                positions[y][x] = new String(posStr);
            }
        }

        for(int y = 0; y < Board.ROWS; ++y) {
            for(int x = 0; x < Board.COLUMNS; ++x) {
                Square square = new Square(positions[y][x]);
                assertSquareCorrect(square, x, y);
            }
        }
    }

    @Test
    public void testPositionStringParsing() {
        Square square;

        square = new Square("c4");
        assertSquareCorrect(square, 2, 3);
        square = new Square("a6");
        assertSquareCorrect(square, 0, 5);
        square = new Square("e1");
        assertSquareCorrect(square, 4, 0);
    }


    @Test<commit_msg>Fix Square string parsing TestCase<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 SquareTest {

    @Test
    public void testAutoPositionStringParsing() {
        String[][] positions = new String[Board.ROWS][Board.COLUMNS];
        for(int y = 0; y < Board.ROWS; ++y) {
            for(int x = 0; x < Board.COLUMNS; ++x) {
                char[] posStr = {
                        (char)((int)'a' + x),
                        (char)((int)'1' + y)
                }; //construct position strings like: "c4"
                positions[y][x] = new String(posStr);
            }
        }

        for(int y = 0; y < Board.ROWS; ++y) {
            for(int x = 0; x < Board.COLUMNS; ++x) {
                Square square = new Square(positions[y][x]);
                assertSquareCorrect(square, x, y);
            }
        }
    }

    @Test
    public void testPositionStringParsing() {
        for(int y = 0; y < 250; ++y) {
            for(int x = 0; x < 250; ++x) {
                Square square = new Square(x, y);
                Square parsedSquare = new Square(square.toString());
                assertEquals(parsedSquare.toString(), square.toString());
            }
        }
    }


    @Test
{'fraction_non_alphanumeric': 0.13261913557443664, 'fraction_numerical': 0.010712966383450314, 'mean_word_length': 1.8120456905503635, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, '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': '7045313', 'n_tokens_mistral': 857, 'n_tokens_neox': 810, 'n_words': 194}