Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0874f7fd
Kaydet (Commit)
0874f7fd
authored
Eki 27, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tests for tokenize.py (Ka-Ping Yee)
üst
fefc922c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
183 additions
and
0 deletions
+183
-0
test_tokenize
Lib/test/output/test_tokenize
+0
-0
test_tokenize.py
Lib/test/test_tokenize.py
+22
-0
tokenize_tests.py
Lib/test/tokenize_tests.py
+161
-0
No files found.
Lib/test/output/test_tokenize
0 → 100644
Dosyayı görüntüle @
0874f7fd
This diff is collapsed.
Click to expand it.
Lib/test/test_tokenize.py
0 → 100644
Dosyayı görüntüle @
0874f7fd
from
test_support
import
verbose
import
tokenize
,
os
,
sys
def
findfile
(
file
):
if
os
.
path
.
isabs
(
file
):
return
file
path
=
sys
.
path
try
:
path
=
[
os
.
path
.
dirname
(
__file__
)]
+
path
except
NameError
:
pass
for
dn
in
path
:
fn
=
os
.
path
.
join
(
dn
,
file
)
if
os
.
path
.
exists
(
fn
):
return
fn
return
file
if
verbose
:
print
'starting...'
file
=
open
(
findfile
(
'tokenize_tests.py'
))
tokenize
.
tokenize
(
file
.
readline
)
if
verbose
:
print
'finished'
Lib/test/tokenize_tests.py
0 → 100644
Dosyayı görüntüle @
0874f7fd
# Tests for the 'tokenize' module.
# Large bits stolen from test_grammar.py.
# Comments
"#"
#'
#"
#\
#
# abc
'''#
#'''
x
=
1
#
# Balancing continuation
a
=
(
3
,
4
,
5
,
6
)
y
=
[
3
,
4
,
5
]
z
=
{
'a'
:
5
,
'b'
:
6
}
x
=
(
len
(
`y`
)
+
5
*
x
-
a
[
3
]
-
x
+
len
({
}
)
)
# Backslash means line continuation:
x
=
1
\
+
1
# Backslash does not means continuation in comments :\
x
=
0
# Ordinary integers
0xff
<>
255
0377
<>
255
2147483647
!=
017777777777
-
2147483647
-
1
!=
020000000000
037777777777
!=
-
1
0xffffffff
!=
-
1
# Long integers
x
=
0L
x
=
0
l
x
=
0xffffffffffffffff
L
x
=
0xffffffffffffffff
l
x
=
077777777777777777
L
x
=
077777777777777777
l
x
=
123456789012345678901234567890L
x
=
123456789012345678901234567890
l
# Floating-point numbers
x
=
3.14
x
=
314.
x
=
0.314
# XXX x = 000.314
x
=
.
314
x
=
3e14
x
=
3E14
x
=
3e-14
x
=
3e+14
x
=
3.e14
x
=
.
3e14
x
=
3.1e4
# String literals
x
=
''
;
y
=
""
;
x
=
'
\'
'
;
y
=
"'"
;
x
=
'"'
;
y
=
"
\"
"
;
x
=
"doesn't
\"
shrink
\"
does it"
y
=
'doesn
\'
t "shrink" does it'
x
=
"does
\"
shrink
\"
doesn't it"
y
=
'does "shrink" doesn
\'
t it'
x
=
"""
The "quick"
brown fox
jumps over
the 'lazy' dog.
"""
y
=
'
\n
The "quick"
\n
brown fox
\n
jumps over
\n
the
\'
lazy
\'
dog.
\n
'
y
=
'''
The "quick"
brown fox
jumps over
the 'lazy' dog.
'''
;
y
=
"
\n\
The
\"
quick
\"\n\
brown fox
\n\
jumps over
\n\
the 'lazy' dog.
\n\
"
;
y
=
'
\n\
The
\"
quick
\"\n\
brown fox
\n\
jumps over
\n\
the
\'
lazy
\'
dog.
\n\
'
;
x
=
r'\\'
+
R'\\'
x
=
r'\''
+
''
y
=
r'''
foo bar \\
baz'''
+
R'''
foo'''
y
=
r"""foo
bar \\ baz
"""
+
R'''spam
'''
# Indentation
if
1
:
x
=
2
if
1
:
x
=
2
if
1
:
while
0
:
if
0
:
x
=
2
x
=
2
if
0
:
if
2
:
while
0
:
if
1
:
x
=
2
# Operators
def
d22
(
a
,
b
,
c
=
1
,
d
=
2
):
pass
def
d01v
(
a
=
1
,
*
rest
,
**
rest
):
pass
(
x
,
y
)
<>
({
'a'
:
1
},
{
'b'
:
2
})
# comparison
if
1
<
1
>
1
==
1
>=
1
<=
1
<>
1
!=
1
in
1
not
in
1
is
1
is
not
1
:
pass
# binary
x
=
1
&
1
x
=
1
^
1
x
=
1
|
1
# shift
x
=
1
<<
1
>>
1
# additive
x
=
1
-
1
+
1
-
1
+
1
# multiplicative
x
=
1
/
1
*
1
%
1
# unary
x
=
~
1
^
1
&
1
|
1
&
1
^
-
1
x
=
-
1
*
1
/
1
+
1
*
1
-
---
1
*
1
# selector
import
sys
,
time
x
=
sys
.
modules
[
'time'
]
.
time
()
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