Alias: more relaxed valid name regex (printable characters instead of "a-z0-9 and some symbols")

This commit is contained in:
jacksonmj 2015-08-21 22:59:02 +00:00
parent 963a17c817
commit d9b21dc5be
2 changed files with 8 additions and 1 deletions

View File

@ -44,6 +44,6 @@ Alias = conf.registerPlugin('Alias')
conf.registerGroup(Alias, 'aliases')
conf.registerGroup(Alias, 'escapedaliases')
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:

View File

@ -127,6 +127,13 @@ class AliasTestCase(ChannelPluginTestCase):
self.assertNotError('alias add myre "echo s/$1/$2/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):
self.assertNotError('alias add exo echo')
self.assertResponse('exo foo bar baz', 'foo bar baz')