from wdr_article_semantic_chunking_2.text_util.sw_writer import match_with_tolerance, match_with_tolerance2


import pytest

@pytest.mark.parametrize(
    "expected, possible, expected_output",
    [
        ([10, 20, 30], [10, 20, 30], {0: True, 1: True}),
        ([10, 20, 30], [12, 23], {0: True, 1: True}),
        ([5, 15], [],  {0: False, }),
        ([9, 21, 34, 57], [9, 10, 22, 23, 26, 35, 36, 47],  {0:True,1:True,2:True, }),
        ([11, 26, 43, 54], [0, 5, 11, 14, 20, 34, 37, 41, 46, 51, 53, 54],  {0:True,1:False,2:True, }),

    ]
)
def test_match_with_tolerance2(expected, possible, expected_output):
    assert match_with_tolerance2(expected, possible) == expected_output
