My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
Changes to /src/lepl/stream/_test/file.py
000000000000 vs. a7dc412647e7 Compare: vs.  Format:
Revision a7dc412647e7
Go to: 
Project members, sign in to write a code review
/src/lepl/stream/_test/file.py /src/lepl/stream/_test/file.py   a7dc412647e7
  1
  2 # LICENCE
  3
  4 from __future__ import print_function
  5 from lepl._test.base import BaseTest
  6 from lepl.lexer.matchers import Token
  7 from lepl.support.lib import str
  8 from tempfile import TemporaryFile
  9
  10
  11 class FileTest(BaseTest):
  12
  13 def test_file(self):
  14 f = TemporaryFile('w+', encoding='utf8')
  15 print("hello world\n", file=f)
  16 f.flush()
  17 # f.seek(0)
  18 # print(f.readlines())
  19 f.seek(0)
  20 w = Token('[a-z]+')
  21 s = Token(' +')
  22 v = w & s & w
  23 v.parse_iterable(f)
  24
  25 # def test_default(self):
  26 # w = Token('[a-z]+')
  27 # s = Token(' +')
  28 # v = w & s & w
  29 # v.parse_string("hello world\n")
  30
  31
  32
  33
Powered by Google Project Hosting