def test_compute_jaccard_index_one_empty_set():
    title1_tokens = {}
    title2_tokens = {'cp', 'violation', 'in', 'the', 'b', 'system'}

    result = compute_jaccard_index(title1_tokens, title2_tokens)

    assert result == 0.0
def test_compute_jaccard_index_different_titles():
    title1_tokens = {'pythia', '6.4', 'physics', 'and', 'manual'}
    title2_tokens = {'cp', 'violation', 'in', 'the', 'b', 'system'}

    result = compute_jaccard_index(title1_tokens, title2_tokens)

    assert result == 0.0
def test_compute_jaccard_index_similar_titles():
    title1_tokens = {'cp', 'violation', 'b'}
    title2_tokens = {'cp', 'violation', 'in', 'the', 'b', 'system'}

    result = compute_jaccard_index(title1_tokens, title2_tokens)

    assert result == 0.5
def test_compute_jaccard_index_perfect_matching_titles():
    title1_tokens = {'cp', 'violation', 'in', 'the', 'b', 'system'}
    title2_tokens = {'cp', 'violation', 'in', 'the', 'b', 'system'}

    result = compute_jaccard_index(title1_tokens, title2_tokens)

    assert result == 1.0