Skip to content

Commit

Permalink
Added hebrew the list of keyboard layouts (nvbn#778)
Browse files Browse the repository at this point in the history
* Added hebrew the list of keyboard layouts.

Fixes nvbn#776.

* Added tests for hebrew layout.

* Fix test.

* Make lint happy.
  • Loading branch information
thedrow authored and nvbn committed Jan 29, 2018
1 parent 78f4436 commit aabd22e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions tests/rules/test_switch_lang.py
Expand Up @@ -7,7 +7,9 @@

@pytest.mark.parametrize('command', [
Command(u'фзе-пуе', 'command not found: фзе-пуе'),
Command(u'λσ', 'command not found: λσ')])
Command(u'λσ', 'command not found: λσ'),
Command(u'שפא-עקא', 'command not found: שפא-עקא'),
Command(u'ךד', 'command not found: ךד')])
def test_match(command):
assert switch_lang.match(command)

Expand All @@ -16,13 +18,16 @@ def test_match(command):
Command(u'pat-get', 'command not found: pat-get'),
Command(u'ls', 'command not found: ls'),
Command(u'агсл', 'command not found: агсл'),
Command(u'фзе-пуе', 'some info')])
Command(u'фзе-пуе', 'some info'),
Command(u'שפא-עקא', 'some info')])
def test_not_match(command):
assert not switch_lang.match(command)


@pytest.mark.parametrize('command, new_command', [
(Command(u'фзе-пуе штыефдд мшь', ''), 'apt-get install vim'),
(Command(u'λσ -λα', ''), 'ls -la')])
(Command(u'λσ -λα', ''), 'ls -la'),
(Command(u'שפא-עקא ןמדאשךך הןצ', ''), 'apt-get install vim'),
(Command(u'ךד -ךש', ''), 'ls -la')])
def test_get_new_command(command, new_command):
assert switch_lang.get_new_command(command) == new_command
3 changes: 2 additions & 1 deletion thefuck/rules/switch_lang.py
Expand Up @@ -5,7 +5,8 @@

source_layouts = [u'''йцукенгшщзхъфывапролджэячсмитьбю.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,''',
u'''ضصثقفغعهخحجچشسیبلاتنمکگظطزرذدپو./ًٌٍَُِّْ][}{ؤئيإأآة»«:؛كٓژٰ‌ٔء><؟''',
u''';ςερτυθιοπ[]ασδφγηξκλ΄ζχψωβνμ,./:΅ΕΡΤΥΘΙΟΠ{}ΑΣΔΦΓΗΞΚΛ¨"ΖΧΨΩΒΝΜ<>?''']
u''';ςερτυθιοπ[]ασδφγηξκλ΄ζχψωβνμ,./:΅ΕΡΤΥΘΙΟΠ{}ΑΣΔΦΓΗΞΚΛ¨"ΖΧΨΩΒΝΜ<>?''',
u'''/'קראטוןםפ][שדגכעיחלךף,זסבהנמצתץ.QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?''']


@memoize
Expand Down

0 comments on commit aabd22e

Please sign in to comment.