# Path: test/_common.py
# def print_test_result(expected, actual, error=None):
#     print(f"[expected]\n{expected}\n")
#     print(f"[actual]\n{actual}\n")
# 
#     if error:
#         print(error, file=sys.stderr)
# 
#     print("----------------------------------------")
# 
# Path: test/data.py
# TIME = datetime.datetime(2017, 1, 1, 0, 0, 0)
# INF = float("inf")
# NAN = float("nan")
# 
# Path: test/writer/text/_common.py
# def strip_ansi_escape(value):


from textwrap import dedent
from ...._common import print_test_result
from ....data import (
    Data,
    headers,
    mix_header_list,
    mix_value_matrix,
    null_test_data_list,
    value_matrix,
    value_matrix_iter,
    value_matrix_with_none,
    vut_style_tabledata,
    vut_styles,
)
from .._common import regexp_ansi_escape, strip_ansi_escape
import pytest
import pytablewriter
                    .. csv-table:: tablename
                        :header: "ha", "hb", "hc"
                        :widths: 5, 5, 5

                        1, 2, 3
                        11, 12, 13
                        1, 2, 3
                        11, 12, 13
                        101, 102, 103
                        1001, 1002, 1003
                    """
                ),
            ]
        ],
    )
    def test_normal(self, capsys, table, header, value, expected):
        writer = table_writer_class()
        writer.table_name = table
        writer.headers = header
        writer.value_matrix = value
        writer.iteration_length = len(value)
        writer.write_table_iter()

        out, err = capsys.readouterr()
        print_test_result(expected=expected, actual=out, error=err)

        assert out == expected

    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],

# Path: test/_common.py
# def print_test_result(expected, actual, error=None):
#     print(f"[expected]\n{expected}\n")
#     print(f"[actual]\n{actual}\n")
# 
#     if error:
#         print(error, file=sys.stderr)
# 
#     print("----------------------------------------")
# 
# Path: test/data.py
# TIME = datetime.datetime(2017, 1, 1, 0, 0, 0)
# INF = float("inf")
# NAN = float("nan")
# 
# Path: test/writer/text/_common.py
# def strip_ansi_escape(value):


# Path: test/writer/text/rst/test_rst_csv_writer.py
from textwrap import dedent
from ...._common import print_test_result
from ....data import (
    Data,
    headers,
    mix_header_list,
    mix_value_matrix,
    null_test_data_list,
    value_matrix,
    value_matrix_iter,
    value_matrix_with_none,
    vut_style_tabledata,
    vut_styles,
)
from .._common import regexp_ansi_escape, strip_ansi_escape
import pytest
import pytablewriter

                    .. csv-table:: tablename
                        :header: "ha", "hb", "hc"
                        :widths: 5, 5, 5

                        1, 2, 3
                        11, 12, 13
                        1, 2, 3
                        11, 12, 13
                        101, 102, 103
                        1001, 1002, 1003
                    """
                ),
            ]
        ],
    )
    def test_normal(self, capsys, table, header, value, expected):
        writer = table_writer_class()
        writer.table_name = table
        writer.headers = header
        writer.value_matrix = value
        writer.iteration_length = len(value)
        writer.write_table_iter()

        out, err = capsys.readouterr()
        print_test_result(expected=expected, actual=out, error=err)

        assert out == expected

    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],

        [[data.table, data.header, data.value, data.expected] for data in null_test_data_list],