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
c7724b5c
Commit
c7724b5c
authored
Nov 06, 2015
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add and enable some tests
parent
e6ba3768
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
7 deletions
+43
-7
from_cpython/Lib/test/test_fractions.py
from_cpython/Lib/test/test_fractions.py
+0
-1
from_cpython/Lib/test/test_long.py
from_cpython/Lib/test/test_long.py
+4
-2
from_cpython/Modules/mathmodule.c
from_cpython/Modules/mathmodule.c
+3
-1
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+0
-3
test/tests/exec_directory.py
test/tests/exec_directory.py
+19
-0
test/tests/long.py
test/tests/long.py
+16
-0
test/tests/no_main_directory/sub_dir/__main__.py
test/tests/no_main_directory/sub_dir/__main__.py
+1
-0
test/tests/no_main_directory/test.py
test/tests/no_main_directory/test.py
+0
-0
No files found.
from_cpython/Lib/test/test_fractions.py
View file @
c7724b5c
# expected: fail
"""Tests for Lib/fractions.py."""
from
decimal
import
Decimal
...
...
from_cpython/Lib/test/test_long.py
View file @
c7724b5c
# expected: fail
import
unittest
import
sys
...
...
@@ -17,7 +16,10 @@ class Frm(object):
return
self
.
format
%
self
.
args
# SHIFT should match the value in longintrepr.h for best testing.
SHIFT
=
sys
.
long_info
.
bits_per_digit
SHIFT
=
64
# Pyston changes: Pyston long implementation not based on digits.
# disable it for now.
# SHIFT = sys.long_info.bits_per_digit
BASE
=
2
**
SHIFT
MASK
=
BASE
-
1
KARATSUBA_CUTOFF
=
70
# from longobject.c
...
...
from_cpython/Modules/mathmodule.c
View file @
c7724b5c
...
...
@@ -1281,7 +1281,9 @@ loghelper(PyObject* arg, double (*func)(double), char *funcname)
Py_ssize_t
e
;
/* Negative or zero inputs give a ValueError. */
if
(
Py_SIZE
(
arg
)
<=
0
)
{
// Pyston change: use _PyLong_Sign instead of Py_SIZE to check
// the sign of long object.
if
(
_PyLong_Sign
(
arg
)
<=
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"math domain error"
);
return
NULL
;
...
...
test/CPYTHON_TEST_NOTES.md
View file @
c7724b5c
...
...
@@ -101,7 +101,6 @@ test_file_eintr not sure
test_fileio [unknown]
test_file wontfix: we don't destruct file objects when the test wants
test_fork1 [unknown]
test_fractions [unknown]
test_frozen [unknown]
test_ftplib [unknown]
test_funcattrs we don't allow changing numing of function defaults
...
...
@@ -141,7 +140,6 @@ test__locale No module named _locale
test_locale [unknown]
test_longexp [unknown]
test_long_future [unknown]
test_long sys.long_info
test_macos Not really a failure, but it tries to skip itself and we don't support that
test_macostools Not really a failure, but it tries to skip itself and we don't support that
test_mailbox [unknown]
...
...
@@ -187,7 +185,6 @@ test_runpy [unknown]
test_sax [unknown]
test_scope eval of code object from existing function (not currently supported)
test_scriptpackages [unknown]
test_set lots of set issues
test_shelve [unknown]
test_shlex [unknown]
test_signal [unknown]
...
...
test/tests/exec_directory.py
0 → 100644
View file @
c7724b5c
import
sys
import
os
import
subprocess
me
=
sys
.
executable
file_path
=
os
.
path
.
dirname
(
__file__
)
with
open
(
'/dev/null'
)
as
ignore
:
def
run
(
args
):
process
=
subprocess
.
Popen
([
me
]
+
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
ignore
)
out
,
err
=
process
.
communicate
()
sys
.
stdout
.
flush
()
print
(
out
)
sys
.
stdout
.
flush
()
run
([
""
.
join
([
file_path
,
"/no_main_directory"
])])
run
([
""
.
join
([
file_path
,
"/no_main_directory/sub_dir"
])])
test/tests/long.py
View file @
c7724b5c
...
...
@@ -146,3 +146,19 @@ print(long(unicode("-3")))
print
(
long
(
x
=
10
))
print
(
long
(
x
=
"10"
,
base
=
10
))
try
:
print
(
long
(
'hek2mgl'
,
22
))
except
Exception
as
e
:
print
(
e
.
message
)
print
(
long
(
'hek2mgl'
,
23
))
print
(
long
(
'hek2mgl'
,
24
))
for
i
in
range
(
-
10
,
10
):
print
(
hash
((
-
1
<<
63
)
+
i
))
print
(
hash
((
1
<<
63
)
+
i
))
for
i
in
xrange
(
100
):
for
j
in
xrange
(
100
):
print
i
,
j
,
hash
((
1
<<
i
)
-
(
1
<<
j
))
test/tests/no_main_directory/sub_dir/__main__.py
0 → 100644
View file @
c7724b5c
print
(
"echo from __main__"
)
test/tests/no_main_directory/test.py
0 → 100644
View file @
c7724b5c
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