Commit df53aebf authored by Michael Arntzenius's avatar Michael Arntzenius

add test/tests/dash_c.py

parent a1be8bf1
import sys
import subprocess
me = sys.executable
with open('/dev/null')as ignore:
# We don't (yet?) require exact stderr or return code compatibility w/
# python. So we just check that we succeed or fail as appropriate.
def run(args):
print 0 == subprocess.call([me] + args, stderr=ignore)
run(["-c", "print 2 + 2"])
run(["-c", "import sys; print sys.argv", "hello", "world"])
run(["-c", "import sys; print sys.argv", "-c", "this is ignored"])
run(["-c"])
run(["-c", "-c"])
run(["-c", "this should not work"])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment