Fix cache upgrade

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138687623
This commit is contained in:
olly 2016-11-09 14:41:22 -08:00 committed by Oliver Woodman
parent ee8a7f17ff
commit aefc5165fd
2 changed files with 7 additions and 1 deletions

View File

@ -84,7 +84,12 @@ public class SimpleCacheSpanTest extends InstrumentationTestCase {
File v1File = createTestFile("asd\u00aa.5.6.v1.exo"); File v1File = createTestFile("asd\u00aa.5.6.v1.exo");
for (File file : cacheDir.listFiles()) { for (File file : cacheDir.listFiles()) {
SimpleCacheSpan.createCacheEntry(file, index); SimpleCacheSpan cacheEntry = SimpleCacheSpan.createCacheEntry(file, index);
if (file.equals(wrongEscapedV2file)) {
assertNull(cacheEntry);
} else {
assertNotNull(cacheEntry);
}
} }
assertTrue(v3file.exists()); assertTrue(v3file.exists());

View File

@ -67,6 +67,7 @@ import java.util.regex.Pattern;
if (file == null) { if (file == null) {
return null; return null;
} }
name = file.getName();
} }
Matcher matcher = CACHE_FILE_PATTERN_V3.matcher(name); Matcher matcher = CACHE_FILE_PATTERN_V3.matcher(name);