diff --git a/comparesv.py b/comparesv.py index b683890..e9d04e2 100644 --- a/comparesv.py +++ b/comparesv.py @@ -247,7 +247,9 @@ def fetch_compare_mode(data_type, string_match): def compare_cells(cell1, cell2, comparison_type, ignore_case): - if not cell1 or not cell2: + if not cell1 and not cell2: + return True + elif not cell1 or not cell2: return False try: diff --git a/tests.py b/tests.py index 7db04fc..e01f20b 100644 --- a/tests.py +++ b/tests.py @@ -13,6 +13,17 @@ def test_basic(): assert result == output['results'] assert values == output['values'] +def test_basic_empty(): + h1 = ["id", "age"] + h2 = ["id", "age"] + d1 = [["A1", 23], ["A2", 24], ["", 34]] + d2 = [["A1", 23], ["A2", 24], ["", 34]] + + result = [[True, True], [True, True], [True, True]] + values = [['[A1]:[A1]', '[23]:[23]'], ['[A2]:[A2]', '[24]:[24]'], ['[]:[]', '[34]:[34]']] + output = comparesv.run(d1, h1, d2, h2) + assert result == output['results'] + assert values == output['values'] def test_column_order(): h1 = ["id", "age"] diff --git a/version.py b/version.py index dae0dfa..9577d7a 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -__version__ = 0.13 \ No newline at end of file +__version__ = 0.14 \ No newline at end of file