[esmre commit] r44 - branches/groups/test

1 view
Skip to first unread message

codesite...@google.com

unread,
Oct 1, 2008, 12:14:32 PM10/1/08
to esmre-c...@googlegroups.com
Author: wharris
Date: Wed Oct 1 09:14:02 2008
New Revision: 44

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$")

Reply all
Reply to author
Forward
0 new messages