diff options
author | cgdecker <cgdecker@google.com> | 2016-01-12 14:48:24 -0800 |
---|---|---|
committer | Colin Decker <cgdecker@google.com> | 2016-01-12 17:53:50 -0500 |
commit | bca9a94cfee80d7a7a4f8bec157fcbd53970357a (patch) | |
tree | 32341222c5f76e76fb30f327bbb58ed0e7d35bf3 /jimfs/src/test/java | |
parent | c60af2ad339164fc47d1e8b86263f41192b72eb7 (diff) | |
download | jimfs-bca9a94cfee80d7a7a4f8bec157fcbd53970357a.tar.gz |
Partially rollback previous change adding Turkish path normalization.
We've determined that NTFS does not do locale-dependent case mapping (and neither do any other file systems we know of), so providing this option is unnecessary and misleading.
I'm leaving the removal of a TODO I had to consider allowing Turkish-correct case folding and also adding in some notes about the whole situation for posterity.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111990375
Diffstat (limited to 'jimfs/src/test/java')
3 files changed, 0 insertions, 95 deletions
diff --git a/jimfs/src/test/java/com/google/common/jimfs/ConfigurationTest.java b/jimfs/src/test/java/com/google/common/jimfs/ConfigurationTest.java index 968feb3..fc9806f 100644 --- a/jimfs/src/test/java/com/google/common/jimfs/ConfigurationTest.java +++ b/jimfs/src/test/java/com/google/common/jimfs/ConfigurationTest.java @@ -17,7 +17,6 @@ package com.google.common.jimfs; import static com.google.common.jimfs.PathNormalization.CASE_FOLD_ASCII; -import static com.google.common.jimfs.PathNormalization.CASE_FOLD_TURKISH; import static com.google.common.jimfs.PathNormalization.CASE_FOLD_UNICODE; import static com.google.common.jimfs.PathNormalization.NFC; import static com.google.common.jimfs.PathNormalization.NFD; @@ -367,14 +366,4 @@ public class ConfigurationTest { assertThat(pollingWatchService.interval).isEqualTo(10); assertThat(pollingWatchService.timeUnit).isEqualTo(MILLISECONDS); } - - @Test - public void testTurkishNormalization() { - Configuration config = - Configuration.windows() - .toBuilder() - .setNameCanonicalNormalization(CASE_FOLD_TURKISH) - .build(); - assertThat(config.nameCanonicalNormalization).containsExactly(CASE_FOLD_TURKISH); - } } diff --git a/jimfs/src/test/java/com/google/common/jimfs/JimfsTurkishCaseInsensitiveFileSystemTest.java b/jimfs/src/test/java/com/google/common/jimfs/JimfsTurkishCaseInsensitiveFileSystemTest.java deleted file mode 100644 index d07b753..0000000 --- a/jimfs/src/test/java/com/google/common/jimfs/JimfsTurkishCaseInsensitiveFileSystemTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.common.jimfs; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.FileSystem; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** - * Tests a Turkish case-insensitive filesystem using public Files APIs. - * - * @author Ben Hamilton - */ -@RunWith(JUnit4.class) -public class JimfsTurkishCaseInsensitiveFileSystemTest extends AbstractJimfsIntegrationTest { - - private static final Configuration TURKISH_CONFIGURATION = - Configuration.windows() - .toBuilder() - .setNameCanonicalNormalization(PathNormalization.CASE_FOLD_TURKISH) - .build(); - - @Override - protected FileSystem createFileSystem() { - return Jimfs.newFileSystem(TURKISH_CONFIGURATION); - } - - @Test - public void caseInsensitiveTurkishMatching() throws IOException { - Files.createDirectory(path("Windows")); - assertThatPath("Windows").isSameFileAs("W\u0130NDOWS"); - assertThatPath("Windows").isNotSameFileAs("WINDOWS"); - Files.createFile(path("SYSTEM.INI")); - assertThatPath("SYSTEM.INI").isNotSameFileAs("system.ini"); - assertThatPath("SYSTEM.INI").isSameFileAs("system.\u0131n\u0131"); - } -} diff --git a/jimfs/src/test/java/com/google/common/jimfs/PathNormalizationTest.java b/jimfs/src/test/java/com/google/common/jimfs/PathNormalizationTest.java index 4d901ab..6fb6d00 100644 --- a/jimfs/src/test/java/com/google/common/jimfs/PathNormalizationTest.java +++ b/jimfs/src/test/java/com/google/common/jimfs/PathNormalizationTest.java @@ -17,7 +17,6 @@ package com.google.common.jimfs; import static com.google.common.jimfs.PathNormalization.CASE_FOLD_ASCII; -import static com.google.common.jimfs.PathNormalization.CASE_FOLD_TURKISH; import static com.google.common.jimfs.PathNormalization.CASE_FOLD_UNICODE; import static com.google.common.jimfs.PathNormalization.NFC; import static com.google.common.jimfs.PathNormalization.NFD; @@ -28,9 +27,7 @@ import static org.junit.Assert.assertTrue; import com.google.common.collect.ImmutableSet; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -46,9 +43,6 @@ public class PathNormalizationTest { private ImmutableSet<PathNormalization> normalizations; - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Test public void testNone() { normalizations = ImmutableSet.of(); @@ -311,29 +305,6 @@ public class PathNormalizationTest { assertNormalizedPatternMatches("AM\u00c9LIE", "AME\u0301LIE"); } - @Test - public void testCaseFoldTurkish() { - normalizations = ImmutableSet.of(CASE_FOLD_TURKISH); - assertNormalizedEqual("hello", "HELLO"); - assertNormalizedEqual("istanbul", "\u0130stanbul"); - assertNormalizedUnequal("istanbul", "ISTANBUL"); - assertNormalizedEqual("Y\u0131ld\u0131r\u0131m", "YILDIRIM"); - assertNormalizedUnequal("Y\u0131ld\u0131r\u0131m", "Yildirim"); - - // My favorites! - assertNormalizedEqual("c:\\windows", "C:\\W\u0130NDOWS"); - assertNormalizedUnequal("c:\\windows", "C:\\WINDOWS"); - assertNormalizedEqual(".git", ".G\u0130T"); - assertNormalizedUnequal(".git", ".GIT"); - } - - @Test - public void testCaseFoldTurkishPatternThrows() { - thrown.expectMessage("Path normalization does not support regular expressions"); - normalizations = ImmutableSet.of(CASE_FOLD_TURKISH); - PathNormalization.compilePattern("hello", normalizations); - } - /** * Asserts that the given strings normalize to the same string using the current normalizer. */ |