Prompt + Regex Lab

Check out the source code at https://github.com/sweepai/prompt-lab


<test_cases>
1. Test when there is a winning condition in a row.
2. Test when there is a winning condition in a column.
3. Test when there is a winning condition in a diagonal.
4. Test when there is no winning condition.
5. Test when the player is "O" instead of "X".
6. Test with an empty or invalid board.

</test_cases>

<unit_test>

```python
import unittest

class TicTacToeTests(unittest.TestCase):
    
    def test_win_in_row(self):
        board = [["X", "X", "X"], [" ", " ", " "], [" ", " ", " "]]
        self.assertTrue(check_tictactoe_win(board, "X"))

    def test_win_in_column(self):
        board = [["X", " ", " "], ["X", " ", " "], ["X", " ", " "]]
        self.assertTrue(check_tictactoe_win(board, "X"))

    def test_win_in_diagonal(self):
        board = [["X", " ", " "], [" ", "X", " "], [" ", " ", "X"]]
        self.assertTrue(check_tictactoe_win(board, "X"))

    def test_no_win(self):
        board = [[" ", " ", " "], [" ", " ", " "], [" ", " ", " "]]
        self.assertFalse(check_tictactoe_win(board, "X"))

    def test_win_with_O(self):
        board = [[ "O", "O", "O"], [ " ", " ", " "], [" ", " ", " "]]
        self.assertTrue(check_tictactoe_win(board, "O"))
        
    def test_invalid_board(self):
        board = [[" ", " ", " "], [" ", " ", " "]]
        with self.assertRaises(IndexError):
            check_tictactoe_win(board, "X")

    # add this line so when the file is run, it runs the tests
    if __name__ == "__main__":
        unittest.main()
```
</unit_test>