Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
851a865c
Commit
851a865c
authored
Jun 04, 2004
by
Hye-Shik Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse width/iswide tests from strings_test. (Suggested by Walter Dörwald)
parent
72fc0c5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
21 deletions
+2
-21
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+2
-21
No files found.
Lib/test/test_unicode.py
View file @
851a865c
...
...
@@ -11,7 +11,8 @@ from test import test_support, string_tests
class
UnicodeTest
(
string_tests
.
CommonTest
,
string_tests
.
MixinStrUnicodeUserStringTest
string_tests
.
MixinStrUnicodeUserStringTest
,
string_tests
.
MixinUnicodeUserStringTest
):
type2test
=
unicode
...
...
@@ -291,26 +292,6 @@ class UnicodeTest(
self
.
assertRaises
(
TypeError
,
u"abc"
.
isnumeric
,
42
)
def
test_iswide
(
self
):
self
.
checkequalnofix
(
False
,
u''
,
'iswide'
)
self
.
checkequalnofix
(
False
,
u'
\
x1f
'
,
'iswide'
)
# Neutral
self
.
checkequalnofix
(
False
,
u'
\
x20
'
,
'iswide'
)
# Narrow
self
.
checkequalnofix
(
True
,
u'
\
u2329
'
,
'iswide'
)
# Wide
self
.
checkequalnofix
(
False
,
u'
\
uff64
'
,
'iswide'
)
# Half
self
.
checkequalnofix
(
True
,
u'
\
u3000
'
,
'iswide'
)
# Full
self
.
checkequalnofix
(
False
,
u'
\
u2460
'
,
'iswide'
)
# Ambiguous
self
.
checkequalnofix
(
True
,
u'
\
ud55c
\
uae00
'
,
'iswide'
)
self
.
checkequalnofix
(
False
,
u'
\
ud55c
\
u2606
\
uae00
'
,
'iswide'
)
def
test_width
(
self
):
self
.
assertEqual
(
u''
.
width
(),
0
)
self
.
assertEqual
(
u'abcd'
.
width
(),
4
)
self
.
assertEqual
(
u'
\
u0187
\
u01c9
'
.
width
(),
2
)
self
.
assertEqual
(
u'
\
u2460
\
u2329
'
.
width
(),
3
)
self
.
assertEqual
(
u'
\
u2329
\
u2460
'
.
width
(),
3
)
self
.
assertEqual
(
u'
\
ud55c
\
uae00
'
.
width
(),
4
)
self
.
assertEqual
(
u'
\
ud55c
\
u2606
\
uae00
'
.
width
(),
5
)
def
test_contains
(
self
):
# Testing Unicode contains method
self
.
assert_
(
'a'
in
u'abdb'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment