Modified:
branches/groups/test/test_esmre.py
Log:
User raw strings for regexs in test.
Modified: branches/groups/test/test_esmre.py
==============================================================================
--- branches/groups/test/test_esmre.py (original)
+++ branches/groups/test/test_esmre.py Wed Oct 1 09:14:02 2008
@@ -27,45 +27,45 @@
self.assertEqual(expected_hints, esmre.hints(regex))
def testSimpleString(self):
- self.checkHints(["yarr"], "yarr")
+ self.checkHints(["yarr"], r"yarr")
def testSkipsOptionalCharacter(self):
- self.checkHints(["dubloon"], "dubloons?")
+ self.checkHints(["dubloon"], r"dubloons?")
def testStartsNewStringAfterOptionalCharacter(self):
- self.checkHints(["ship", "shape"], "ship ?shape")
+ self.checkHints(["ship", "shape"], r"ship ?shape")
def testSkipsOptionalRepeatedCharacter(self):
- self.checkHints(["bristol", "fasion"], "bristol *fasion")
+ self.checkHints(["bristol", "fasion"], r"bristol *fasion")
def testIncludesRepeatedCharacterButStartsNewHint(self):
self.checkHints(["ava", "st me harties"],
- "ava+st me harties")
+ r"ava+st me harties")
def testSkipsGroups(self):
self.checkHints(["Hoist the ", ", ye ", "!"],
- "Hoist the (mizzen mast|main brace), "
- "ye (landlubbers|scurvy dogs)!")
+ r"Hoist the (mizzen mast|main brace), "
+ r"ye (landlubbers|scurvy dogs)!")
def testSkipsAny(self):
self.checkHints(["After 10 paces, ", " marks the spot"],
- "After 10 paces, . marks the spot")
+ r"After 10 paces, . marks the spot")
def testSkipsOneOrMoreAny(self):
self.checkHints(["Hard to ", "!"],
- "Hard to .+!")
+ r"Hard to .+!")
def testSkipsNestedGroups(self):
self.checkHints(["Squark!"],
- "Squark!( Pieces of (.+)!)")
+ r"Squark!( Pieces of (.+)!)")
def testSkipsCharacterClass(self):
self.checkHints(["r"],
- "[ya]a*r+")
+ r"[ya]a*r+")
def testRightBracketDoesNotCloseGroupIfInClass(self):
self.checkHints([":=", "X"],
- ":=([)D])X")
+ r":=([)D])X")
def testSkipsBackslashMetacharacters(self):
self.checkHints(["Cap'n", " "],
@@ -91,7 +91,7 @@
self.checkHints([], r"rum|grog")
def testSkipMatchBeginning(self):
- self.checkHints(["The black perl"], "^The black perl")
+ self.checkHints(["The black perl"], r"^The black perl")
def testSkipMatchEnd(self):
self.checkHints(["Davey Jones' Locker"], r"Davey Jones' Locker$")