diff --git a/tests/test_check.py b/tests/test_check.py index b9f8619..6580638 100644 --- a/tests/test_check.py +++ b/tests/test_check.py @@ -59,6 +59,19 @@ def test_check_invalid_separators(capsys): assert captured.out == f"Invalid multi-value separator ({field_name}): {value}\n" +def test_check_unnecessary_separators(capsys): + """Test checking unnecessary multi-value separators.""" + + field = "Alan||Orth||" + + field_name = "dc.contributor.author" + + check.separators(field, field_name) + + captured = capsys.readouterr() + assert captured.out == f"Unnecessary multi-value separator ({field_name}): {field}\n" + + def test_check_valid_separators(): """Test checking valid multi-value separators.""" diff --git a/tests/test_fix.py b/tests/test_fix.py index a2cd066..b53bb1a 100644 --- a/tests/test_fix.py +++ b/tests/test_fix.py @@ -41,6 +41,16 @@ def test_fix_invalid_separators(): assert fix.separators(value, field_name) == "Alan||Orth" +def test_fix_unnecessary_separators(): + """Test fixing unnecessary multi-value separators.""" + + field = "Alan||Orth||" + + field_name = "dc.contributor.author" + + assert fix.separators(field, field_name) == "Alan||Orth" + + def test_fix_unnecessary_unicode(): """Test fixing unnecessary Unicode."""