Skip to content

Commit

Permalink
Fix find function
Browse files Browse the repository at this point in the history
  • Loading branch information
QX-CHEN committed Sep 29, 2020
1 parent 81504cb commit 41acfac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public CommandResult execute(TaskList tasks) {
filteredTasks.add(tasks.get(i));
}
}
return new CommandResult(FIND_MESSAGE, tasks);
return new CommandResult(FIND_MESSAGE, filteredTasks);
}
}
17 changes: 16 additions & 1 deletion text-ui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,24 @@
____________________________________________________________
____________________________________________________________
Noted. I've removed this task:
[D][T] return book (by: 2020-01-19 1700)
[E][T] meeting (at: 2020-03-20 1700-1900)
Now you have 4 task(s) in the list.
____________________________________________________________
____________________________________________________________
Here are the tasks in your list:
1. [T][X] borrow book
2. [D][T] return book (by: 2020-01-19 1700)
3. [E][X] project meeting (at: 2019-03-20 1500-1530)
4. [D][X] Report (by: 2020-09-20 2200)
____________________________________________________________
____________________________________________________________
Here are the matching tasks in your list:
____________________________________________________________
____________________________________________________________
Here are the matching tasks in your list:
1. [T][X] borrow book
2. [D][T] return book (by: 2020-01-19 1700)
____________________________________________________________
____________________________________________________________
Bye. Hope to see you again soon!
____________________________________________________________
5 changes: 4 additions & 1 deletion text-ui-test/input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ delete 0
delete -1
delete 4
list
delete 2
delete 4
list
find vook
find book
bye

0 comments on commit 41acfac

Please sign in to comment.