Skip to content

Commit

Permalink
Allow commands/bundles to start with uppercase letters.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmohoric committed Aug 28, 2017
1 parent c5c9094 commit f8789eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/piper_cmd2_name_lexer.xrl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Definitions.

NAME = [a-z][a-zA-Z0-9_\-]*
NAME = [a-zA-Z][a-zA-Z0-9_\-]*
HIPCHAT_EMOJI = \([a-zA-Z0-9_\-\+]+\)
SLACK_EMOJI = :[a-zA-Z0-9_\-\+]+:
COLON = :
Expand Down
6 changes: 6 additions & 0 deletions test/command/parser/parser_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ defmodule Parser.ParserTest do
{:error, "illegal characters \"\u1E23\""} = Parser.scan_and_parse("#{@unicode_text}:say_it 123")
end

test "capitalized names should work" do
should_parse "Foo:bar"
should_parse "Foo:Bar"
should_parse "foo:Bar"
end

test "malformed command names" do
should_not_parse ":foo bar"
should_not_parse "foo: bar"
Expand Down

0 comments on commit f8789eb

Please sign in to comment.