Skip to content

Commit f6658db

Browse files
committed
Add unit test for case insensitivity in command
1 parent 43e83c6 commit f6658db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test-src/command-handler.sjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const messages = {
3939
detect: {
4040
trigger: chanmsg(format('!%s', commandname)),
4141
highlight: chanmsg(format('%s: %s', nickname, commandname)),
42+
case_insensitive_highlight: chanmsg(format('%s: %s', nickname.toUpperCase(), commandname)),
4243
query: privmsg(format('%s', commandname)),
4344
query_with_trigger: privmsg(format('!%s', commandname)),
4445
highlight_oddspacing: chanmsg(format(' %s: %s ', nickname, commandname)),
@@ -75,6 +76,13 @@ describe 'Command Handler' {
7576
assert(equal(command.args, []));
7677
}
7778

79+
it 'Highlights in case insensitive way' {
80+
const command = handler.parse(Message(messages.detect.case_insensitive_highlight));
81+
82+
assert(command.command === commandname);
83+
assert(equal(command.args, []));
84+
}
85+
7886
it 'Query' {
7987
const command = handler.parse(Message(messages.detect.query));
8088

0 commit comments

Comments
 (0)