Show More
@@ -137,7 +137,7 b' def test_latex_completions():' | |||||
137 | text, matches = ip.complete(k) |
|
137 | text, matches = ip.complete(k) | |
138 | nt.assert_equal(len(matches),1) |
|
138 | nt.assert_equal(len(matches),1) | |
139 | nt.assert_equal(text, k) |
|
139 | nt.assert_equal(text, k) | |
140 |
|
|
140 | nt.assert_equal(matches[0], latex_symbols[k]) | |
141 | # Test a more complex line |
|
141 | # Test a more complex line | |
142 | text, matches = ip.complete(u'print(\\alpha') |
|
142 | text, matches = ip.complete(u'print(\\alpha') | |
143 | nt.assert_equals(text, u'\\alpha') |
|
143 | nt.assert_equals(text, u'\\alpha') |
@@ -16,7 +16,6 b" CodeMirror.requireMode('python',function(){" | |||||
16 | pythonConf.name = 'python'; |
|
16 | pythonConf.name = 'python'; | |
17 | pythonConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]"); |
|
17 | pythonConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]"); | |
18 | if (pythonConf.version === 3) { |
|
18 | if (pythonConf.version === 3) { | |
19 | console.log('setting up for python 3'); |
|
|||
20 | pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); |
|
19 | pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); | |
21 | } else if (pythonConf.version === 2) { |
|
20 | } else if (pythonConf.version === 2) { | |
22 | pythonConf.identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); |
|
21 | pythonConf.identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); |
@@ -46,13 +46,10 b' lines = [line_to_tuple(line) for line in lines]' | |||||
46 | print('Filtering out characters that are not valid Python 3 identifiers') |
|
46 | print('Filtering out characters that are not valid Python 3 identifiers') | |
47 |
|
47 | |||
48 | def test_ident(i): |
|
48 | def test_ident(i): | |
49 |
"""Is the unicode string |
|
49 | """Is the unicode string valid in a Python 3 identifer.""" | |
50 | try: |
|
50 | # Some characters are not valid at the start of a name, but we still want to | |
51 | exec('a%s = 10' % i, {}, {}) |
|
51 | # include them. So prefix with 'a', which is valid at the start. | |
52 | except SyntaxError: |
|
52 | return ('a' + i).isidentifier() | |
53 | return False |
|
|||
54 | else: |
|
|||
55 | return True |
|
|||
56 |
|
53 | |||
57 | assert test_ident("α") |
|
54 | assert test_ident("α") | |
58 | assert not test_ident('‴') |
|
55 | assert not test_ident('‴') |
General Comments 0
You need to be logged in to leave comments.
Login now