Beispiel #1
0
        /// <summary>
        /// this test performs a number of searches. It also compares output
        ///  of searches using multi-file index segments with single-file
        ///  index segments.
        /// 
        ///  TODO: someone should check that the results of the searches are
        ///        still correct by adding assert statements. Right now, the test
        ///        passes if the results are the same between multi-file and
        ///        single-file formats, even if the results are wrong.
        /// </summary>
        public virtual void TestSearch()
        {
            StringWriter sw = new StringWriter();
              PrintWriter pw = new PrintWriter(sw, true);
              DoTestSearch(random(), pw, false);
              pw.close();
              sw.close();
              string multiFileOutput = sw.ToString();
              //System.out.println(multiFileOutput);

              sw = new StringWriter();
              pw = new PrintWriter(sw, true);
              DoTestSearch(random(), pw, true);
              pw.close();
              sw.close();
              string singleFileOutput = sw.ToString();

              Assert.AreEqual(multiFileOutput, singleFileOutput);
        }