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


import collections
import itertools
import pytest
import pytablewriter as ptw
from textwrap import dedent
from ..._common import print_test_result
from ...data import (
    float_header_list,
    float_value_matrix,
    headers,
    mix_header_list,
    mix_value_matrix,
    value_matrix,
    value_matrix_iter,
    value_matrix_with_none,
)

Data = collections.namedtuple("Data", "col_delim header value expected")

normal_test_data_list = [
    Data(
        col_delim=",",
        header=headers,
        value=value_matrix,
        expected=dedent(
            """\
            "a","b","c","dd","e"
            1,123.1,"a",1,1
            2,2.2,"bb",2.2,2.2
            3,3.3,"ccc",3,"cccc"
            """
        ),
    ),
    Data(
        col_delim=",",
        header=headers,
        value=[],
        expected=dedent(
            """\
            "a","b","c","dd","e"
            """
        ),
    ),
    Data(
        col_delim=",",
        header=[],

# 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/test_csv_writer.py
import collections
import itertools
import pytest
import pytablewriter as ptw
from textwrap import dedent
from ..._common import print_test_result
from ...data import (
    float_header_list,
    float_value_matrix,
    headers,
    mix_header_list,
    mix_value_matrix,
    value_matrix,
    value_matrix_iter,
    value_matrix_with_none,
)


Data = collections.namedtuple("Data", "col_delim header value expected")

normal_test_data_list = [
    Data(
        col_delim=",",
        header=headers,
        value=value_matrix,
        expected=dedent(
            """\
            "a","b","c","dd","e"
            1,123.1,"a",1,1
            2,2.2,"bb",2.2,2.2
            3,3.3,"ccc",3,"cccc"
            """
        ),
    ),
    Data(
        col_delim=",",
        header=headers,
        value=[],
        expected=dedent(
            """\
            "a","b","c","dd","e"
            """
        ),
    ),
    Data(
        col_delim=",",
        header=[],

        value=value_matrix,