mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-22 18:14:41 +01:00
Utilities: Add @sort.
This commit is contained in:
parent
65a7935214
commit
bfa45a6da8
@ -104,6 +104,15 @@ class Utilities(callbacks.Plugin):
|
||||
irc.reply(' '.join(things))
|
||||
shuffle = wrap(shuffle, [many('anything')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def sort(self, irc, msg, args, things):
|
||||
"""<arg> [<arg> ...]
|
||||
|
||||
Sorts the arguments given.
|
||||
"""
|
||||
irc.reply(' '.join(sorted(things)))
|
||||
sort = wrap(sort, [many('anything')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def sample(self, irc, msg, args, num, things):
|
||||
"""<num> <arg> [<arg> ...]
|
||||
|
@ -62,6 +62,9 @@ class UtilitiesTestCase(PluginTestCase):
|
||||
def testShuffle(self):
|
||||
self.assertResponse('shuffle a', 'a')
|
||||
|
||||
def testSort(self):
|
||||
self.assertResponse('sort abc cab cba bca', 'abc bca cab cba')
|
||||
|
||||
def testSample(self):
|
||||
self.assertResponse('sample 1 a', 'a')
|
||||
self.assertError('sample moo')
|
||||
|
Loading…
Reference in New Issue
Block a user