Changeset 228

Show
Ignore:
Timestamp:
12/30/07 00:16:49 (1 year ago)
Author:
chris
Message:

Add tests with several results and no results.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lex/trunk/test/com/qwirx/lex/SearchTest.java

    r225 r228  
    3535    } 
    3636     
    37     public void testSearchCode() throws Exception 
    38     { 
    39         List<SearchResult> actualResults = new Search("CMJM/", m_Emdros).run(); 
     37    private void assertSearchResultsMatch(String query) throws Exception 
     38    { 
     39        List<SearchResult> actualResults = new Search(query, m_Emdros).run(); 
    4040        Iterator<SearchResult> actualIterator = actualResults.iterator(); 
    4141         
     
    5252            "graphical_nominal_ending, " + 
    5353            "graphical_pron_suffix"; 
    54          
    55         String query = "CMJM/"; 
    5654         
    5755        Sheaf sheaf = m_Emdros.getSheaf 
     
    138136         
    139137        assertFalse(actualIterator.hasNext()); 
     138    } 
     139 
     140    public void testSearchCode() throws Exception 
     141    { 
     142        assertSearchResultsMatch("CMJM/"); 
     143        assertSearchResultsMatch("W"); 
     144        assertSearchResultsMatch("foo"); 
    140145    } 
    141146