summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_select.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-11-11 10:31:23 (GMT)
committerGuido van Rossum <guido@python.org>1993-11-11 10:31:23 (GMT)
commitb31c7f732aea6abf6ce24d3da7fd67b2172acec9 (patch)
treee97a352f4308578604255065063766f303ee788d /Lib/test/test_select.py
parent52f2c05401ab13eab45a91d39089866f55ef3c9b (diff)
downloadcpython-b31c7f732aea6abf6ce24d3da7fd67b2172acec9.zip
cpython-b31c7f732aea6abf6ce24d3da7fd67b2172acec9.tar.gz
cpython-b31c7f732aea6abf6ce24d3da7fd67b2172acec9.tar.bz2
* test_select.py: (some) tests for built-in select module
* test_grammar.py, testall.out: added test for funny things in string literals * token.py, symbol.py: definitions used with built-in parser module. * tokenize.py: added double-quote recognition
Diffstat (limited to 'Lib/test/test_select.py')
-rw-r--r--Lib/test/test_select.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py
new file mode 100644
index 0000000..89088ef
--- /dev/null
+++ b/Lib/test/test_select.py
@@ -0,0 +1,25 @@
+# Testing select module
+
+from test_support import *
+
+def test():
+ import select
+ import os
+ cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do date; sleep 3; done'
+ p = os.popen(cmd, 'r')
+ for tout in (0, 1, 2, 4, 8, 16) + (None,)*10:
+ print 'timeout =', tout
+ rfd, wfd, xfd = select.select([p], [], [], tout)
+ print rfd, wfd, xfd
+ if (rfd, wfd, xfd) == ([], [], []):
+ continue
+ if (rfd, wfd, xfd) == ([p], [], []):
+ line = p.readline()
+ print `line`
+ if not line:
+ print 'EOF'
+ break
+ continue
+ print 'Heh?'
+
+test()