mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Alias: more relaxed valid name regex (printable characters instead of "a-z0-9 and some symbols")
This commit is contained in:
parent
963a17c817
commit
d9b21dc5be
@ -44,6 +44,6 @@ Alias = conf.registerPlugin('Alias')
|
|||||||
conf.registerGroup(Alias, 'aliases')
|
conf.registerGroup(Alias, 'aliases')
|
||||||
conf.registerGroup(Alias, 'escapedaliases')
|
conf.registerGroup(Alias, 'escapedaliases')
|
||||||
conf.registerGlobalValue(Alias, 'validName',
|
conf.registerGlobalValue(Alias, 'validName',
|
||||||
registry.String(r'^[a-z.|!?][a-z0-9.|!]*$', _("""Regex which alias names must match in order to be valid""")))
|
registry.String(r'^[^\x00-\x20]+$', _("""Regex which alias names must match in order to be valid""")))
|
||||||
|
|
||||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||||
|
@ -127,6 +127,13 @@ class AliasTestCase(ChannelPluginTestCase):
|
|||||||
self.assertNotError('alias add myre "echo s/$1/$2/g"')
|
self.assertNotError('alias add myre "echo s/$1/$2/g"')
|
||||||
self.assertResponse('myre foo bar', 's/foo/bar/g')
|
self.assertResponse('myre foo bar', 's/foo/bar/g')
|
||||||
|
|
||||||
|
def testUnicode(self):
|
||||||
|
self.assertNotError(u'alias add \u200b echo foo')
|
||||||
|
self.assertResponse(u'\u200b', 'foo')
|
||||||
|
|
||||||
|
self.assertNotError(u'alias add café echo bar')
|
||||||
|
self.assertResponse(u'café', 'bar')
|
||||||
|
|
||||||
def testSimpleAliasWithoutArgsImpliesDollarStar(self):
|
def testSimpleAliasWithoutArgsImpliesDollarStar(self):
|
||||||
self.assertNotError('alias add exo echo')
|
self.assertNotError('alias add exo echo')
|
||||||
self.assertResponse('exo foo bar baz', 'foo bar baz')
|
self.assertResponse('exo foo bar baz', 'foo bar baz')
|
||||||
|
Loading…
Reference in New Issue
Block a user