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")
def testCondenseDigits(self): builder = ReBuilder() builder.addLine("1") builder.addLine("2") builder.addLine("3") builder.addLine("4") assert builder.match("5")
def testSingleLine(self): builder = ReBuilder() builder.addLine("This is a test line") assert builder.match("This is a test line")
def testIncrementalAddLine(self): builder = ReBuilder() builder.addLine("a").addLine("b") assert builder.match("a") assert builder.match("b")
def testSingleChar(self): builder = ReBuilder() builder.addLine("a") assert builder.match("a")