Permalink
Browse files

Update split_user_input unicode test.

  • Loading branch information...
takluyver committed Aug 18, 2011
1 parent 974068c commit 8c63d48b25de99fe0feb6d63c7e0fd3fdd4306cc
Showing with 6 additions and 8 deletions.
  1. +0 −8 IPython/core/tests/test_inputsplitter.py
  2. +6 −0 IPython/core/tests/test_splitinput.py
@@ -390,14 +390,6 @@ def test_LineInfo():
linfo = isp.LineInfo(' %cd /home')
nt.assert_equals(str(linfo), 'LineInfo [ |%|cd|/home]')
-
-def test_split_user_input():
- """Unicode test - split_user_input already has good doctests"""
- line = u"Pérez Fernando"
- parts_expected = (u'', u'', u'', line)
- tt.check_pairs(isp.split_user_input, [(line, parts_expected),])
-
-
# Transformer tests
def transform_checker(tests, func):
"""Utility to loop over test inputs"""
@@ -1,5 +1,7 @@
+# coding: utf-8
from IPython.core.splitinput import split_user_input
from IPython.testing import tools as tt
+from IPython.utils import py3compat
tests = [
('x=1', ('', '', 'x', '=1')),
@@ -21,6 +23,10 @@
('?%hist', ('', '?', '%hist', '')),
('?x*', ('', '?', 'x*', '')),
]
+if py3compat.PY3:
+ tests.append((u"Pérez Fernando", (u'', u'', u'Pérez', u'Fernando')))
+else:
+ tests.append((u"Pérez Fernando", (u'', u'', u'P', u'érez Fernando')))
def test_split_user_input():
return tt.check_pairs(split_user_input, tests)

0 comments on commit 8c63d48

Please sign in to comment.