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
76afd3b8
Commit
76afd3b8
authored
Feb 14, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
we're no longer using CVS, so this doesn't have to be binary
parent
09d3d2de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
Lib/test/test_pep263.py
Lib/test/test_pep263.py
+30
-31
No files found.
Lib/test/test_pep263.py
View file @
76afd3b8
#! -*- coding: koi8-r -*-
# This file is marked as binary in SVN, to prevent MacCVS from recoding it.
import
unittest
from
test
import
test_support
class
PEP263Test
(
unittest
.
TestCase
):
def
test_pep263
(
self
):
self
.
assertEqual
(
u""
.
encode
(
"utf-8"
),
'
\
xd0
\
x9f
\
xd0
\
xb8
\
xd1
\
x82
\
xd0
\
xbe
\
xd0
\
xbd
'
)
self
.
assertEqual
(
u"
\
"
.encode("
utf
-
8
"),
'
\
\
\
xd0
\
x9f
'
)
def test_compilestring(self):
# see #1882
c = compile("
\
n
# coding: utf-8\nu = u'\xc3\xb3'\n", "dummy", "exec")
d
=
{}
exec
c
in
d
self
.
assertEqual
(
d
[
'u'
],
u'
\
xf3
'
)
def
test_main
():
test_support
.
run_unittest
(
PEP263Test
)
if
__name__
==
"__main__"
:
test_main
()
#! -*- coding: koi8-r -*-
import
unittest
from
test
import
test_support
class
PEP263Test
(
unittest
.
TestCase
):
def
test_pep263
(
self
):
self
.
assertEqual
(
u""
.
encode
(
"utf-8"
),
'
\
xd0
\
x9f
\
xd0
\
xb8
\
xd1
\
x82
\
xd0
\
xbe
\
xd0
\
xbd
'
)
self
.
assertEqual
(
u"
\
"
.encode("
utf
-
8
"),
'
\
\
\
xd0
\
x9f
'
)
def test_compilestring(self):
# see #1882
c = compile("
\
n
# coding: utf-8\nu = u'\xc3\xb3'\n", "dummy", "exec")
d
=
{}
exec
c
in
d
self
.
assertEqual
(
d
[
'u'
],
u'
\
xf3
'
)
def
test_main
():
test_support
.
run_unittest
(
PEP263Test
)
if
__name__
==
"__main__"
:
test_main
()
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