# 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 datetime
import pytest
import typepy
import pytablewriter
from textwrap import dedent
from ...._common import print_test_result
from ....data import (
    headers,
    mix_header_list,
    mix_value_matrix,
    value_matrix,
    value_matrix_iter,
    value_matrix_with_none,
)
                [1, null, "a", 1, null],
                [null, 2.2, null, 2.2, 2.2],
                [3, 3.3, "ccc", null, "cccc"],
                [null, null, null, null, null]
            ];
            """
        ),
    ),
    Data(
        table="tablename",
        indent=0,
        header=mix_header_list,
        value=mix_value_matrix,
        is_write_header=True,
        is_dti_fmt=True,
        expected=dedent(
            """\
            const tablename = [
                ["i", "f", "c", "if", "ifc", "bool", "inf", "nan", "mix_num", "time"],
                [1, 1.1, "aa", 1, 1, true, Infinity, NaN, 1, new Date("2017-01-01T00:00:00")],
                [2, 2.2, "bbb", 2.2, 2.2, false, Infinity, NaN, Infinity, "2017-01-02 03:04:05+09:00"],
                [3, 3.33, "cccc", -3, "ccc", true, Infinity, NaN, NaN, new Date("2017-01-01T00:00:00")]
            ];
            """
        ),
    ),
    Data(
        table="tablename",
        indent=0,
        header=mix_header_list,

# 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/sourcecode/test_javascript_writer.py
import collections
import datetime
import pytest
import typepy
import pytablewriter
from textwrap import dedent
from ...._common import print_test_result
from ....data import (
    headers,
    mix_header_list,
    mix_value_matrix,
    value_matrix,
    value_matrix_iter,
    value_matrix_with_none,
)

                [1, null, "a", 1, null],
                [null, 2.2, null, 2.2, 2.2],
                [3, 3.3, "ccc", null, "cccc"],
                [null, null, null, null, null]
            ];
            """
        ),
    ),
    Data(
        table="tablename",
        indent=0,
        header=mix_header_list,
        value=mix_value_matrix,
        is_write_header=True,
        is_dti_fmt=True,
        expected=dedent(
            """\
            const tablename = [
                ["i", "f", "c", "if", "ifc", "bool", "inf", "nan", "mix_num", "time"],
                [1, 1.1, "aa", 1, 1, true, Infinity, NaN, 1, new Date("2017-01-01T00:00:00")],
                [2, 2.2, "bbb", 2.2, 2.2, false, Infinity, NaN, Infinity, "2017-01-02 03:04:05+09:00"],
                [3, 3.33, "cccc", -3, "ccc", true, Infinity, NaN, NaN, new Date("2017-01-01T00:00:00")]
            ];
            """
        ),
    ),
    Data(
        table="tablename",
        indent=0,
        header=mix_header_list,

        value=mix_value_matrix,