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
74ca557e
Commit
74ca557e
authored
Mar 17, 2008
by
Eric Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for tokenize, blocked corresponding checkin from trunk.
parent
f1bb97c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Lib/test/test_tokenize.py
Lib/test/test_tokenize.py
+10
-2
No files found.
Lib/test/test_tokenize.py
View file @
74ca557e
...
...
@@ -4,7 +4,7 @@ Tests for the tokenize module.
>>> import glob, random, sys
The tests can be really simple. Given a small fragment of source
code, print out a table with t
h
okens. The ENDMARK is omitted for
code, print out a table with tokens. The ENDMARK is omitted for
brevity.
>>> dump_tokens("1 + 1")
...
...
@@ -105,7 +105,7 @@ Some error-handling code
... "else: print 'Loaded'
\
\
n")
True
Balancing cont
u
nuation
Balancing cont
i
nuation
>>> roundtrip("a = (3,4,
\
\
n"
... "5,6)
\
\
n"
...
...
@@ -125,6 +125,14 @@ Ordinary integers and binary operators
NUMBER '0xff' (1, 0) (1, 4)
OP '<=' (1, 5) (1, 7)
NUMBER '255' (1, 8) (1, 11)
>>> dump_tokens("0b10 <= 255")
NUMBER '0b10' (1, 0) (1, 4)
OP '<=' (1, 5) (1, 7)
NUMBER '255' (1, 8) (1, 11)
>>> dump_tokens("0o123 <= 0O123")
NUMBER '0o123' (1, 0) (1, 5)
OP '<=' (1, 6) (1, 8)
NUMBER '0O123' (1, 9) (1, 14)
>>> dump_tokens("1234567 > ~0x15")
NUMBER '1234567' (1, 0) (1, 7)
OP '>' (1, 8) (1, 9)
...
...
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