def test_lex_exception():
 try:
  tokenize('(foo')
  assert (True is False)
 except PrematureEndOfInput:
  pass
 try:
  tokenize('{foo bar')
  assert (True is False)
 except PrematureEndOfInput:
  pass
 try:
  tokenize('(defn foo [bar]')
  assert (True is False)
 except PrematureEndOfInput:
  pass
 try:
  tokenize('(foo "bar')
  assert (True is False)
 except PrematureEndOfInput:
  pass

def test_lex_exception ( ) : try : tokenize ( '(foo' ) assert ( True is False ) except PrematureEndOfInput : pass try : tokenize ( '{foo bar' ) assert ( True is False ) except PrematureEndOfInput : pass try : tokenize ( '(defn foo [bar]' ) assert ( True is False ) except PrematureEndOfInput : pass try : tokenize ( '(foo "bar' ) assert ( True is False ) except PrematureEndOfInput : pass
ensure tokenize throws a fit on a partial input .