mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed a bug where addFactoid wasn't splitting on the first "is"
This commit is contained in:
parent
1d1d7a87c2
commit
82d2d8162a
@ -212,7 +212,7 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def addFactoid(self, irc, msg, match):
|
def addFactoid(self, irc, msg, match):
|
||||||
r"^(.+)\s+(?:is|_is_)\s+(.+)"
|
r"^(.+?)\s+(?:is|_is_)\s+(.+)"
|
||||||
# First, check and see if the entire message matches a factoid key
|
# First, check and see if the entire message matches a factoid key
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
cursor.execute("""SELECT * FROM factoids WHERE key LIKE %s""",
|
cursor.execute("""SELECT * FROM factoids WHERE key LIKE %s""",
|
||||||
|
@ -51,6 +51,8 @@ if sqlite is not None:
|
|||||||
self.assertError('moo!? is foo') # 'moo' already exists
|
self.assertError('moo!? is foo') # 'moo' already exists
|
||||||
self.assertNotError('foo!? is foo')
|
self.assertNotError('foo!? is foo')
|
||||||
self.assertResponse('foo', 'foo is foo')
|
self.assertResponse('foo', 'foo is foo')
|
||||||
|
self.assertNotError('bar is <reply>moo is moo')
|
||||||
|
self.assertResponse('bar', 'moo is moo')
|
||||||
|
|
||||||
def testLiteral(self):
|
def testLiteral(self):
|
||||||
self.assertError('literal moo') # no factoids yet
|
self.assertError('literal moo') # no factoids yet
|
||||||
|
Loading…
Reference in New Issue
Block a user