Esempio n. 1
0
 def testDateStamp(self):
     builder = ReBuilder()
     stamps = ["2011-01-01", "2010-09-27", "2011-04-23", "2010-12-31", "2009-06-14"]
     for stamp in stamps:
         builder.addLine(stamp)
         assert builder.match(stamp)
     assert builder.match("2011-03-12")
Esempio n. 2
0
 def testCondenseDigits(self):
     builder = ReBuilder()
     builder.addLine("1")
     builder.addLine("2")
     builder.addLine("3")
     builder.addLine("4")
     assert builder.match("5")
Esempio n. 3
0
 def testSingleLine(self):
     builder = ReBuilder()
     builder.addLine("This is a test line")
     assert builder.match("This is a test line")
Esempio n. 4
0
 def testIncrementalAddLine(self):
     builder = ReBuilder()
     builder.addLine("a").addLine("b")
     assert builder.match("a")
     assert builder.match("b")
Esempio n. 5
0
 def testSingleChar(self):
     builder = ReBuilder()
     builder.addLine("a")
     assert builder.match("a")