Exemple #1
0
def test_2_misspells_in_3_words():
    line = ' let testDiffrentBegining = "test"'
    result = spell_check(line=line)
    assert result == [{
        'src': 'testDiffrentBegining',
        'dst': 'testDifferentBeginning'
    }]
Exemple #2
0
def test_1_misspell_in_3_words():
    line = ' let testBeginingContents = "test"'
    result = spell_check(line=line)
    assert result == [{
        'src': 'testBeginingContents',
        'dst': 'testBeginningContents'
    }]
Exemple #3
0
def test_3_misspells_in_2_definitions():
    line = ' let beginingDiffrent = "test"; var appriciateBracketDot = "test"'
    result = spell_check(line=line)
    assert result == [{
        'src': 'beginingDiffrent',
        'dst': 'beginningDifferent'
    }, {
        'src': 'appriciateBracketDot',
        'dst': 'appreciateBracketDot'
    }]
Exemple #4
0
def test_0_misspell_in_1_word():
    line = ' let bracket = "test"'
    result = spell_check(line=line)
    assert len(result) == 0
Exemple #5
0
def test_3_misspells_with_2_ignores_in_2_definitions():
    line = ' let beginingDiffrent = "test"; var appriciateBracketDot = "test"'
    ignore_list = ['begining', 'appriciate']
    result = spell_check(line=line, ignore_list=ignore_list)
    assert result == [{'src': 'beginingDiffrent', 'dst': 'beginingDifferent'}]
Exemple #6
0
def test_1_misspell_in_2_definitions():
    line = ' let begining = "test"; var appreciate = "test"'
    result = spell_check(line=line)
    assert result == [{'src': 'begining', 'dst': 'beginning'}]
Exemple #7
0
def test_1_misspell_in_1_word():
    line = ' let begining = "test"'
    result = spell_check(line=line)
    assert result == [{'src': 'begining', 'dst': 'beginning'}]