From 0a09551f34d0e2952dd46c4287fb40981c139df5 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 20 Jan 2012 16:15:29 +0000 Subject: [PATCH] LUCENE-3661: hack test for simpletext case git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3661@1233981 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/index/TestBackwardsCompatibility.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java index 6def7697165..9929a07172b 100644 --- a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java +++ b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java @@ -497,17 +497,25 @@ public class TestBackwardsCompatibility extends LuceneTestCase { writer.deleteDocuments(searchTerm); writer.close(); - // Now verify file names: + // Now verify file names... TODO: fix this test better, we could populate from + // separateFiles() or something. String[] expected = new String[] {"_0.cfs", "_0.cfe", "_0_1.del", "segments_2", "segments.gen"}; + + String[] expectedSimpleText = new String[] {"_0.cfs", "_0.cfe", + "_0_1.liv", + "segments_2", + "segments.gen"}; String[] actual = dir.listAll(); Arrays.sort(expected); + Arrays.sort(expectedSimpleText); Arrays.sort(actual); - if (!Arrays.equals(expected, actual)) { - fail("incorrect filenames in index: expected:\n " + asString(expected) + "\n actual:\n " + asString(actual)); + if (!Arrays.equals(expected, actual) && !Arrays.equals(expectedSimpleText, actual)) { + fail("incorrect filenames in index: expected:\n " + asString(expected) + + "\n or " + asString(expectedSimpleText) + "\n actual:\n " + asString(actual)); } dir.close(); } finally {