# 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):


import collections
import pytest
import pytablewriter as ptw
from ..._common import print_test_result
from ...data import (
    float_header_list,
    float_value_matrix,
    mix_header_list,
    mix_value_matrix,
    value_matrix,
    vut_style_tabledata,
    vut_styles,
)
from ._common import regexp_ansi_escape, strip_ansi_escape
        ["header", "value", "expected"],
        [[data.header, data.value, data.expected] for data in normal_test_data_list],
    )
    def test_normal(self, capsys, header, value, expected):
        writer = table_writer_class()
        writer.headers = header
        writer.value_matrix = value
        writer.write_table()

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

        assert out == expected
        assert writer.dumps() == expected
        assert str(writer) == expected

    def test_normal_styles(self):
        writer = table_writer_class()
        writer.from_tabledata(vut_style_tabledata)
        writer.column_styles = vut_styles

        expected = r"""\begin{array}{r | r | r | r | r | r | l | r | r | r} \hline
    \verb|none| & \verb|empty| & \verb|  tiny   | & \verb|  small   | & \verb|     medium     | & \verb|   large   | & \verb|null w/ bold| & \verb|   L bold    | & \verb|  S italic   | & \verb| L bold italic  | \\ \hline
    \hline
     111 &   111 & \tiny 111 & \small 111 &  \normalsize 111 &  \large 111 &              & \large \bf 111 & \small \it 111 & \large \bf \it 111 \\ \hline
    1234 &  1234 & \tiny 1234 & \small 1234 & \normalsize 1,234 & \large 1 234 &              & \large \bf 1234 & \small \it 1234 & \large \bf \it 1234 \\ \hline
\end{array}
"""

        out = writer.dumps()

# 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/test_latex_table_writer.py
import collections
import pytest
import pytablewriter as ptw
from ..._common import print_test_result
from ...data import (
    float_header_list,
    float_value_matrix,
    mix_header_list,
    mix_value_matrix,
    value_matrix,
    vut_style_tabledata,
    vut_styles,
)
from ._common import regexp_ansi_escape, strip_ansi_escape

        ["header", "value", "expected"],
        [[data.header, data.value, data.expected] for data in normal_test_data_list],
    )
    def test_normal(self, capsys, header, value, expected):
        writer = table_writer_class()
        writer.headers = header
        writer.value_matrix = value
        writer.write_table()

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

        assert out == expected
        assert writer.dumps() == expected
        assert str(writer) == expected

    def test_normal_styles(self):
        writer = table_writer_class()
        writer.from_tabledata(vut_style_tabledata)
        writer.column_styles = vut_styles

        expected = r"""\begin{array}{r | r | r | r | r | r | l | r | r | r} \hline
    \verb|none| & \verb|empty| & \verb|  tiny   | & \verb|  small   | & \verb|     medium     | & \verb|   large   | & \verb|null w/ bold| & \verb|   L bold    | & \verb|  S italic   | & \verb| L bold italic  | \\ \hline
    \hline
     111 &   111 & \tiny 111 & \small 111 &  \normalsize 111 &  \large 111 &              & \large \bf 111 & \small \it 111 & \large \bf \it 111 \\ \hline
    1234 &  1234 & \tiny 1234 & \small 1234 & \normalsize 1,234 & \large 1 234 &              & \large \bf 1234 & \small \it 1234 & \large \bf \it 1234 \\ \hline
\end{array}
"""

        out = writer.dumps()

        print_test_result(expected=expected, actual=out)