<commit_before>package guitests;

import org.junit.Test;
import seedu.address.commons.core.Messages;
import seedu.address.testutil.TestTask;

import static org.junit.Assert.assertTrue;

public class FilterCommandTest extends TaskManagerGuiTest {

    @Test
    public void filter_nonEmptyList() {
        assertFilterResult("filter d/12.10.2016"); //no results
        commandBox.runCommand("list");
        assertFilterResult("filter d/11.10.2016", td.friendEvent, td.work); //multiple results

        //find after deleting one result
        commandBox.runCommand("delete 1");
        assertFilterResult("filter d/11.10.2016",td.work);
        
        // Filter for event start date
        commandBox.runCommand("list");
        assertFilterResult("filter s/11.10.2016",td.travel);
    }

    @Test
    public void filter_emptyList(){
        commandBox.runCommand("clear");
        assertFilterResult("filter d/11.10.2016"); //no results
    }

    @Test
    public void filter_invalidCommand_fail() {
        commandBox.runCommand("filterd/11.10.2016");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    private void assertFilterResult(String command, TestTask... expectedHits ) {
        commandBox.runCommand(command);
        assertListSize(expectedHits.length);
        assertResultMessage(expectedHits.length + " tasks listed!");
        assertTrue(taskListPanel.isListMatching(expectedHits));
    }

}
<commit_msg>Add test for filterr command<commit_after>package guitests;

import org.junit.Test;
import seedu.address.commons.core.Messages;
import seedu.address.logic.commands.FilterCommand;
import seedu.address.testutil.TestTask;

import static org.junit.Assert.assertTrue;
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

public class FilterCommandTest extends TaskManagerGuiTest {

    @Test
    public void filter_nonEmptyList() {
        assertFilterResult("filter d/12.10.2016"); //no results
        assertFilterResult("filter d/11.10.2016", td.friendEvent, td.work); //multiple results
        assertFilterResult("filter s/11.10.2016", td.travel);
        assertFilterResult("filter e/11.10.2016-12", td.meeting);
        assertFilterResult("filter t/friends", td.friend, td.friendEvent, td.lunch);

        //filter after add one result
        TestTask taskToAdd = td.lecture;
        commandBox.runCommand(taskToAdd.getAddCommand());
        assertFilterResult("filter r/weekly", taskToAdd);
        
    }

    @Test
    public void filter_emptyList(){
        commandBox.runCommand("clear");
        assertFilterResult("filter d/11.10.2016"); //no results
    }

    @Test
    public void filter_invalidCommand_fail() {
        commandBox.runCommand("filterd/11.10.2016");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
        commandBox.runCommand("filter");
        assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE));
    }

    private void assertFilterResult(String command, TestTask... expectedHits ) {
        commandBox.runCommand(command);
        assertListSize(expectedHits.length);
        assertResultMessage(expectedHits.length + " tasks listed!");
        assertTrue(taskListPanel.isListMatching(expectedHits));
    }

}

{'fraction_non_alphanumeric': 0.1093512031678343, 'fraction_numerical': 0.030155345720377702, 'mean_word_length': 3.4619565217391304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3622483', 'n_tokens_mistral': 985, 'n_tokens_neox': 917, 'n_words': 167}