<commit_before>from unittest import TestCase
import cross.game as cgame


class TestGame(TestCase):
    """ Test suite for the basic game logic """

    def test_piece_instantiation(self):
        p = cgame.Piece(cgame.TroopType.Spearman, cgame.Color.White)
        assert p.trooptype == cgame.TroopType.Spearman
        assert p.color == cgame.Color.White

    def test_position_index(self):
        """ Tests conversion of (H, V) coordinate to 0-based index """
        zero = cgame.Position(1, 'A')
        idx = cgame.Position(4, 'C')
        final = cgame.Position(9, 'I')
        assert 0 == zero.index
        assert 21 == idx.index
        assert 80 == final.index

    def test_starting_board(self):
        """ Tests the validity of the starting board """
        b = cgame.new_board()
        sp, sw, a, h, g = cgame.TroopType.__iter__()
        b, w = cgame.Color.__iter__()
        p = cgame.Piece
        expected = cgame.create_board([
            [p(sp, w), p(sw, w), p(sw, w), p(h, w), p(g, w), p(h, w), p(sw, w), p(sw, w), p(sp, w)],
            [p(sp, w), p(sp, w), p(sw, w), p(a, w), p(a, w), p(a, w), p(sw, w), p(sp, w), p(sp, w)],
            [], [], [], [], [],
            [p(sp, b), p(sp, b), p(sw, b), p(a, b), p(a, b), p(a, b), p(sw, b), p(sp, b), p(sp, b)],
            [p(sp, b), p(sw, b), p(sw, b), p(h, b), p(g, b), p(h, b), p(sw, b), p(sw, b), p(sp, b)]])
        assert expected == b<commit_msg>Fixed two typos in the starting board test<commit_after>from unittest import TestCase
import cross.game as cgame


class TestGame(TestCase):
    """ Test suite for the basic game logic """

    def test_piece_instantiation(self):
        p = cgame.Piece(cgame.TroopType.Spearman, cgame.Color.White)
        assert p.trooptype == cgame.TroopType.Spearman
        assert p.color == cgame.Color.White

    def test_position_index(self):
        """ Tests conversion of (H, V) coordinate to 0-based index """
        zero = cgame.Position(1, 'A')
        idx = cgame.Position(4, 'C')
        final = cgame.Position(9, 'I')
        assert 0 == zero.index
        assert 21 == idx.index
        assert 80 == final.index

    def test_starting_board(self):
        """ Tests the validity of the starting board """
        starting = cgame.new_board()
        sw, sp, a, h, g = cgame.TroopType.__iter__()
        b, w = cgame.Color.__iter__()
        p = cgame.Piece
        expected = cgame.create_board([
            [p(sp, w), p(sw, w), p(sw, w), p(h, w), p(g, w), p(h, w), p(sw, w), p(sw, w), p(sp, w)],
            [p(sp, w), p(sp, w), p(sw, w), p(a, w), p(a, w), p(a, w), p(sw, w), p(sp, w), p(sp, w)],
            [], [], [], [], [],
            [p(sp, b), p(sp, b), p(sw, b), p(a, b), p(a, b), p(a, b), p(sw, b), p(sp, b), p(sp, b)],
            [p(sp, b), p(sw, b), p(sw, b), p(h, b), p(g, b), p(h, b), p(sw, b), p(sw, b), p(sp, b)]])
        assert expected == starting
{'fraction_non_alphanumeric': 0.19454984477406, 'fraction_numerical': 0.006209037599172128, 'mean_word_length': 2.3878504672897196, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1423896', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1090, 'n_words': 318}