Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.7
diff -u -p -r1.7 search.test
--- modules/search/search.test	6 Sep 2008 08:36:20 -0000	1.7
+++ modules/search/search.test	14 Sep 2008 13:53:21 -0000
@@ -2,6 +2,7 @@
 // $Id: search.test,v 1.7 2008/09/06 08:36:20 dries Exp $
 
 define('SEARCH_TYPE', '_test_');
+define('SEARCH_TYPE_2', '_test2_');
 
 class SearchMatchTestCase extends DrupalWebTestCase {
   /**
@@ -39,11 +40,14 @@ class SearchMatchTestCase extends Drupal
     for ($i = 1; $i <= 7; ++$i) {
       search_index($i, SEARCH_TYPE, $this->getText($i));
     }
+    for ($i = 1; $i <= 5; ++$i) {
+      search_index($i + 7, SEARCH_TYPE_2, $this->getText2($i));
+    }
     search_update_totals();
   }
 
   /**
-   * Helper method for generating snippets of content.
+   * _test_: Helper method for generating snippets of content.
    *
    * Generated items to test against:
    *   1  ipsum
@@ -60,6 +64,21 @@ class SearchMatchTestCase extends Drupal
   }
 
   /**
+   * _foo_: Helper method for generating snippets of content.
+   *
+   * Generated items to test against:
+   *   8  dear
+   *   9  king philip
+   *   10 philip came over
+   *   11 came over from germany
+   *   12 over from germany swimming
+   */
+  function getText2($n) {
+    $words = explode(' ', "Dear King Philip came over from Germany swimming.");
+    return implode(' ', array_slice($words, $n - 1, $n));
+  }
+
+  /**
    * Run predefine queries looking for indexed terms.
    */
   function _testQueries() {
@@ -119,6 +138,21 @@ class SearchMatchTestCase extends Drupal
       $this->_testQueryMatching($query, $set, $results);
       $this->_testQueryScores($query, $set, $results);
     }
+    
+    // These queries are run against the second index type, SEARCH_TYPE_2.
+    $queries = array(
+      // Simple AND queries.
+      'ipsum' => array(),
+      'enim' => array(),
+      'enim minim' => array(),
+      'dear' => array(8),
+      'germany' => array(11, 12),
+    );
+    foreach ($queries as $query => $results) {
+      $set = do_search($query, SEARCH_TYPE_2);
+      $this->_testQueryMatching($query, $set, $results);
+      $this->_testQueryScores($query, $set, $results);
+    }
   }
 
   /**
