mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 02:54:05 +01:00
Aka: Fix combination of required and optional arguments.
Was broken by 7f43727835
(why?)
This commit is contained in:
parent
b00081f6c9
commit
5272bf3a86
@ -467,6 +467,7 @@ class Aka(callbacks.Plugin):
|
||||
replace(tokens, lambda s: dollarRe.sub(regexpReplace, s))
|
||||
if biggestAt:
|
||||
assert not wildcard
|
||||
args = args[biggestDollar:]
|
||||
replace(tokens, lambda s: atRe.sub(regexpReplace, s))
|
||||
if wildcard:
|
||||
assert not biggestAt
|
||||
|
@ -135,6 +135,11 @@ class AkaChannelTestCase(ChannelPluginTestCase):
|
||||
self.assertResponse('myrepr foo', '"foo"')
|
||||
self.assertResponse('myrepr ""', '""')
|
||||
|
||||
def testRequiredAndOptional(self):
|
||||
self.assertNotError('aka add reqopt "echo req=$1, opt=@1"')
|
||||
self.assertResponse('reqopt foo bar', 'req=foo, opt=bar')
|
||||
self.assertResponse('reqopt foo', 'req=foo, opt=')
|
||||
|
||||
def testNoExtraSpaces(self):
|
||||
self.assertNotError('aka add foo "action takes $1\'s money"')
|
||||
self.assertResponse('foo bar', '\x01ACTION takes bar\'s money\x01')
|
||||
|
Loading…
Reference in New Issue
Block a user