Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[W7][T08-1] Zhao JunRu #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Format: `find KEYWORD [MORE_KEYWORDS]`

[NOTE]
====
The search is case sensitive, the order of the keywords does not matter, only the name is searched,
The search is case insensitive, the order of the keywords does not matter, only the name is searched,
and persons matching at least one keyword will be returned (i.e. `OR` search).
====

Expand Down
2 changes: 1 addition & 1 deletion src/seedu/addressbook/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Command parseCommand(String userInput) {
return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));
}

final String commandWord = matcher.group("commandWord");
final String commandWord = matcher.group("commandWord").toLowerCase();
final String arguments = matcher.group("arguments");
switch (commandWord) {

Expand Down
8 changes: 8 additions & 0 deletions test/java/seedu/addressbook/parser/ParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ public void findCommand_duplicateKeys_parsedCorrectly() {
parseAndAssertCommandType(input, FindCommand.class);
assertEquals(keySet, result.getKeywords());
}
/**
* Test commands in upper case
*/
@Test
public void uppercaseCommand_parsedCorrectly() {
final String input = "LIST";
parseAndAssertCommandType(input, ListCommand.class);
}

/**
* Test add person command
Expand Down