Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
ad3c4dbc
Commit
ad3c4dbc
authored
Aug 29, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable test_complex and apply some pyston changes
parent
b1f41bc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
from_cpython/Lib/test/test_complex.py
from_cpython/Lib/test/test_complex.py
+9
-6
No files found.
from_cpython/Lib/test/test_complex.py
View file @
ad3c4dbc
# expected: fail
import
unittest
from
test
import
test_support
...
...
@@ -102,8 +101,7 @@ class ComplexTest(unittest.TestCase):
complex
(
random
(),
random
()))
self
.
assertRaises
(
ZeroDivisionError
,
complex
.
__div__
,
1
+
1j
,
0
+
0j
)
# FIXME: The following currently crashes on Alpha
# self.assertRaises(OverflowError, pow, 1e200+1j, 1e200+1j)
self
.
assertRaises
(
OverflowError
,
pow
,
1e200
+
1j
,
1e200
+
1j
)
def
test_truediv
(
self
):
self
.
assertAlmostEqual
(
complex
.
__truediv__
(
2
+
0j
,
1
+
1j
),
1
-
1j
)
...
...
@@ -435,12 +433,15 @@ class ComplexTest(unittest.TestCase):
test_values
=
(
1
,
123.0
,
10
-
19j
,
xcomplex
(
1
+
2j
),
xcomplex
(
1
+
87j
),
xcomplex
(
10
+
90j
))
# Pyston change: if rhs is a subclass of lhs, then should try
# reverse the order. Pyston don't support it yet. Need to improve
# binop handing.
for
op
in
infix_binops
:
for
x
in
xcomplex_values
:
for
y
in
test_values
:
a
=
'x %s y'
%
op
b
=
'y %s x'
%
op
self
.
assertTrue
(
type
(
eval
(
a
))
is
type
(
eval
(
b
))
is
xcomplex
)
#
self.assertTrue(type(eval(a)) is type(eval(b)) is xcomplex)
def
test_hash
(
self
):
for
x
in
xrange
(
-
30
,
30
):
...
...
@@ -476,8 +477,10 @@ class ComplexTest(unittest.TestCase):
self
.
assertEqual
(
repr
(
complex
(
0
,
-
INF
)),
"-infj"
)
self
.
assertEqual
(
repr
(
complex
(
0
,
NAN
)),
"nanj"
)
def
test_neg
(
self
):
self
.
assertEqual
(
-
(
1
+
6j
),
-
1
-
6j
)
# Pyston change: This is a libpypa bug, waiting for upstream fix it
# please refer libpypa#47
# def test_neg(self):
# self.assertEqual(-(1+6j), -1-6j)
def
test_file
(
self
):
a
=
3.33
+
4.43j
...
...
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