{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/34219568","id":34219568,"diff_hunk":"@@ -1,221 +1,371 @@\n ﻿// Copyright (c) Microsoft. All rights reserved.\n // Licensed under the MIT license. See LICENSE file in the project root for full license information.\n \n-using System;\n-using System.IO;\n using Xunit;\n \n-public class Directory_GetFileSystemEntries_str_str : Directory_GetFileSystemEntries_str\n+namespace System.IO.FileSystem.Tests\n {\n-    #region Utilities\n-\n-    /// <summary>\n-    /// Makes all parent tests run with a wildcard Search Parameter\n-    /// </summary>\n-    public override String[] GetEntries(String dirName)\n+    public class Directory_GetFileSystemEntries_str_str : Directory_GetFileSystemEntries_str\n     {\n-        return System.IO.Directory.GetFileSystemEntries(dirName, \"*\");\n-    }\n+        #region Utilities\n \n-    /// <summary>\n-    /// Indirection around Directory.GetFileSystemEntries that child test classes may\n-    /// replace with a more fitting version\n-    /// </summary>\n-    public virtual String[] GetEntries(String dirName, String searchPattern)\n-    {\n-        return System.IO.Directory.GetFileSystemEntries(dirName, searchPattern);\n-    }\n+        public override string[] GetEntries(string dirName)\n+        {\n+            return Directory.GetFileSystemEntries(dirName, \"*\");\n+        }\n \n-    #endregion\n+        public virtual string[] GetEntries(string dirName, string searchPattern)\n+        {\n+            return Directory.GetFileSystemEntries(dirName, searchPattern);\n+        }\n \n-    #region UniversalTests\n+        #endregion\n \n-    [Fact]\n-    public void NullSearchPattern()\n-    {\n-        Assert.Throws<ArgumentNullException>(() => GetEntries(TestDirectory, null));\n-    }\n+        #region UniversalTests\n \n-    [Fact]\n-    public void EmptySearchPattern()\n-    {\n-        // To avoid OS differences we have decided not to throw an argument exception when empty\n-        // string passed. But we should return 0 items.\n-        Assert.Empty(GetEntries(TestDirectory, \"\"));\n-    }\n+        [Fact]\n+        public void SearchPatternNull()\n+        {\n+            Assert.Throws<ArgumentNullException>(() => GetEntries(TestDirectory, null));\n+        }\n \n-    [Fact]\n-    public void ValidSearchPattern()\n-    {\n-        String strTempDir = \"a..b abc..d\";\n-        Assert.Empty(GetEntries(TestDirectory, strTempDir)); //Should not throw\n-    }\n+        [Fact]\n+        public void SearchPatternEmpty()\n+        {\n+            // To avoid OS differences we have decided not to throw an argument exception when empty\n+            // string passed. But we should return 0 items.\n+            Assert.Empty(GetEntries(TestDirectory, string.Empty));\n+        }\n+        public void SearchPatternValid()\n+        {\n+            Assert.Empty(GetEntries(TestDirectory, \"a..b abc..d\")); //Should not throw\n+        }\n \n-    [Fact]\n-    public void SearchPatternWithTrailingStar()\n-    {\n-        DirectoryInfo testDir = new DirectoryInfo(TestDirectory);\n-        testDir.CreateSubdirectory(\"TestDir1\");\n-        testDir.CreateSubdirectory(\"TestDir2\");\n-        testDir.CreateSubdirectory(\"TestDir3\");\n-        using (File.Create(Path.Combine(TestDirectory, \"TestFile1\")))\n-        using (File.Create(Path.Combine(TestDirectory, \"TestFile2\")))\n-        using (File.Create(Path.Combine(TestDirectory, \"Test1File2\")))\n-        using (File.Create(Path.Combine(TestDirectory, \"Test1Dir2\")))\n-        {\n-            String[] strArr = GetEntries(TestDirectory, \"Test1*\");\n-            Assert.Equal(2, strArr.Length);\n-            Assert.Contains(Path.Combine(TestDirectory, \"Test1File2\"), strArr);\n-            Assert.Contains(Path.Combine(TestDirectory, \"Test1Dir2\"), strArr);\n+        [Fact]\n+        public void SearchPatternWithTrailingStar()\n+        {\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            testDir.CreateSubdirectory(\"TestDir1\");\n+            testDir.CreateSubdirectory(\"TestDir2\");\n+            testDir.CreateSubdirectory(\"TestDir3\");\n+            using (File.Create(Path.Combine(testDir.FullName, \"TestFile1\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"TestFile2\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"Test1File2\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"Test1Dir2\")))\n+            {\n+                string[] strArr = GetEntries(testDir.FullName, \"Test1*\");\n+                if (TestFiles)\n+                { \n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1File2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1Dir2\"), strArr);\n+                }\n+\n+                strArr = GetEntries(testDir.FullName, \"*\");\n+                if (TestFiles)\n+                {\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestFile1\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestFile2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1File2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1Dir2\"), strArr);\n+                }\n+                if (TestDirectories)\n+                {\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir1\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir3\"), strArr);\n+                }\n+            }\n         }\n-    }\n \n-    [Fact]\n-    public void SearchPatternWithLeadingStar()\n-    {\n-        DirectoryInfo testDir = new DirectoryInfo(TestDirectory);\n-        testDir.CreateSubdirectory(\"TestDir1\");\n-        testDir.CreateSubdirectory(\"TestDir2\");\n-        testDir.CreateSubdirectory(\"TestDir3\");\n-        using (File.Create(Path.Combine(TestDirectory, \"TestFile1\")))\n-        using (File.Create(Path.Combine(TestDirectory, \"TestFile2\")))\n-        using (File.Create(Path.Combine(TestDirectory, \"Test1File2\")))\n-        using (File.Create(Path.Combine(TestDirectory, \"Test1Dir2\")))\n-        {\n-            String[] strArr = GetEntries(TestDirectory, \"*2\");\n-            Assert.Equal(4, strArr.Length);\n-            Assert.Contains(Path.Combine(TestDirectory, \"Test1Dir2\"), strArr);\n-            Assert.Contains(Path.Combine(TestDirectory, \"TestDir2\"), strArr);\n-            Assert.Contains(Path.Combine(TestDirectory, \"Test1File2\"), strArr);\n-            Assert.Contains(Path.Combine(TestDirectory, \"TestFile2\"), strArr);\n-\n-            strArr = GetEntries(TestDirectory, \"*Dir2\");\n-            Assert.Equal(2, strArr.Length);\n-            Assert.Contains(Path.Combine(TestDirectory, \"Test1Dir2\"), strArr);\n-            Assert.Contains(Path.Combine(TestDirectory, \"TestDir2\"), strArr);\n+        [Fact]\n+        public void SearchPatternWithLeadingStar()\n+        {\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            testDir.CreateSubdirectory(\"TestDir1\");\n+            testDir.CreateSubdirectory(\"TestDir2\");\n+            testDir.CreateSubdirectory(\"TestDir3\");\n+            using (File.Create(Path.Combine(testDir.FullName, \"TestFile1\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"TestFile2\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"Test1File2\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"Test1Dir2\")))\n+            {\n+                string[] strArr = GetEntries(testDir.FullName, \"*2\");\n+                if (TestFiles)\n+                {\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1Dir2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1File2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestFile2\"), strArr);\n+                }\n+                if (TestDirectories)\n+                {\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir2\"), strArr);\n+                }\n+\n+                strArr = GetEntries(testDir.FullName, \"*Dir*\");\n+                if (TestFiles)\n+                {\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"Test1Dir2\"), strArr);\n+                }\n+                if (TestDirectories)\n+                {\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir1\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir2\"), strArr);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"TestDir3\"), strArr);\n+                }\n+            }\n         }\n-    }\n \n-    [Fact]\n-    public void SearchPatternCaseSensitivity()\n-    {\n-        DirectoryInfo testDir = new DirectoryInfo(TestDirectory);\n-        using (File.Create(Path.Combine(TestDirectory, \"AAABB\")))\n+        [Fact]\n+        public void SearchPatternExactMatch()\n         {\n-            System.IO.Directory.CreateDirectory(Path.Combine(TestDirectory, \"aaabbcc\"));\n-            String[] strArr = GetEntries(TestDirectory, \"*BB*\");\n-            Assert.Contains(Path.Combine(TestDirectory, \"AAABB\"), strArr);\n-            if (Interop.IsWindows || Interop.IsOSX)\n-                Assert.Contains(Path.Combine(TestDirectory, \"aaabbcc\"), strArr);\n-            else\n-                Assert.DoesNotContain(Path.Combine(TestDirectory, \"aaabbcc\"), strArr);\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            Directory.CreateDirectory(Path.Combine(testDir.FullName, \"AAA\"));\n+            Directory.CreateDirectory(Path.Combine(testDir.FullName, \"AAAB\"));\n+            Directory.CreateDirectory(Path.Combine(testDir.FullName, \"CAAA\"));\n+            using (File.Create(Path.Combine(testDir.FullName, \"AAABB\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"AAABBC\")))\n+            using (File.Create(Path.Combine(testDir.FullName, \"CAAABB\")))\n+            {\n+                if (TestFiles)\n+                {\n+                    string[] results = GetEntries(testDir.FullName, \"AAABB\");\n+                    Assert.Equal(1, results.Length);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"AAABB\"), results);\n+                }\n+                if (TestDirectories)\n+                {\n+                    string[] results = GetEntries(testDir.FullName, \"AAA\");\n+                    Assert.Equal(1, results.Length);\n+                    Assert.Contains(Path.Combine(testDir.FullName, \"AAA\"), results);\n+                }\n+            }\n         }\n-    }\n \n-    [Fact]\n-    public void SearchPatternNonFullPath()\n-    {\n-        //Shouldn't get files on full path by default\n-        String testDir1Str = GetTestFileName();\n-        DirectoryInfo testDir = new DirectoryInfo(TestDirectory);\n-        testDir.CreateSubdirectory(testDir1Str);\n-        using (File.Create(Path.Combine(TestDirectory, testDir1Str, GetTestFileName())))\n+        [Fact]\n+        public void SearchPatternIgnoreSubDirectories()\n         {\n-            Assert.Equal(1, GetEntries(TestDirectory, Path.Combine(testDir1Str, \"*\")).Length);\n+            //Shouldn't get files on full path by default\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            Directory.CreateDirectory(Path.Combine(testDir.FullName, GetTestFileName()));\n+            using (File.Create(Path.Combine(testDir.FullName, GetTestFileName())))\n+            using (File.Create(Path.Combine(TestDirectory, GetTestFileName())))\n+            {\n+                string[] results = GetEntries(TestDirectory, Path.Combine(testDir.Name, \"*\"));\n+                if (TestDirectories && TestFiles)\n+                    Assert.Equal(2, results.Length);\n+                else\n+                    Assert.Equal(1, results.Length);\n+            }\n         }\n-    }\n \n-    [Fact]\n-    public void SearchPatternIgnoreSubDirectories()\n-    {\n-        String testDir = GetTestFileName();\n-        String testFile1 = Path.Combine(TestDirectory, GetTestFileName());\n-        String testFile2 = Path.Combine(TestDirectory, testDir, GetTestFileName());\n-        Directory.CreateDirectory(Path.Combine(TestDirectory, testDir));\n-        using (File.Create(testFile1))\n-        using (File.Create(testFile2))\n+        [Fact]\n+        [ActiveIssue(645)]\n+        public void SearchPatternLongPathAllowed()\n         {\n-            String[] results = GetEntries(Directory.GetCurrentDirectory(), Path.Combine(new DirectoryInfo(TestDirectory).Name, \"*\"));\n-            Assert.Contains(testFile1, results);\n-            Assert.DoesNotContain(testFile2, results);\n+            //Create a destination path longer than the traditional Windows limit of 256 characters\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            string longName = new string('k', 257);\n+\n+            using (File.Create(Path.Combine(testDir.FullName, longName)))\n+            {\n+                string[] results = GetEntries(testDir.FullName, longName);\n+                Assert.Contains(Path.Combine(testDir.FullName, longName), results);\n+            }\n         }\n-    }\n \n-    #endregion\n+        #endregion\n \n-    #region WindowsOnly\n+        #region PlatformSpecific\n \n-    [Fact]\n-    [PlatformSpecific(PlatformID.Windows)]\n-    public void WindowsWildCharactersSearchPattern()\n-    {\n-        String strTempDir = Path.Combine(\"dls;d\", \"442349-0\", \"v443094(*)(+*$#$*\") +\n-                            new string(Path.DirectorySeparatorChar, 3);\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, strTempDir));\n-    }\n+        [Fact]\n+        [PlatformSpecific(PlatformID.Windows)]\n+        public void WindowsSearchPatternWithDoubleDots()\n+        {\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, Path.Combine(\"..ab ab.. .. abc..d\", \"abc..\")));\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \"..\"));\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, @\"..\" + Path.DirectorySeparatorChar));\n+        }\n \n-    [Fact]\n-    [PlatformSpecific(PlatformID.Windows)]\n-    public void WindowsSearchPatternWithSpaces()\n-    {\n-        Assert.Empty(GetEntries(TestDirectory, \"           \"));\n-        Assert.Empty(GetEntries(TestDirectory, \"\\n\"));\n-        Assert.Empty(GetEntries(TestDirectory, \" \"));\n-        Assert.Empty(GetEntries(TestDirectory, \"\"));\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \"\\0\"));\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \">\"));\n-    }\n+        [Fact]\n+        [PlatformSpecific(PlatformID.Windows)]\n+        public void WindowsSearchPatternInvalid()\n+        {\n+            Char[] invalidFileNames = Path.GetInvalidFileNameChars();\n+            for (int i = 0; i < invalidFileNames.Length; i++)\n+            {\n+                switch (invalidFileNames[i])\n+                {\n+                    case '\\\\':\n+                    case '/':\n+                        Assert.Throws<DirectoryNotFoundException>(() => GetEntries(Directory.GetCurrentDirectory(), string.Format(\"te{0}st\", invalidFileNames[i].ToString())));\n+                        break;\n+                    //We dont throw in V1 too\n+                    case ':':\n+                        //History:\n+                        // 1) we assumed that this will work in all non-9x machine\n+                        // 2) Then only in XP\n+                        // 3) NTFS?\n+                        if (Interop.IsWindows && FileSystemDebugInfo.IsCurrentDriveNTFS()) // testing NTFS\n+                            Assert.Throws<IOException>(() => GetEntries(Directory.GetCurrentDirectory(), string.Format(\"te{0}st\", invalidFileNames[i].ToString())));\n+                        else\n+                            GetEntries(Directory.GetCurrentDirectory(), string.Format(\"te{0}st\", invalidFileNames[i].ToString()));\n \n-    [Fact]\n-    [PlatformSpecific(PlatformID.Windows)]\n-    public void WindowsSearchPatternWithDoubleDots()\n-    {\n-        string strTempDir = Path.Combine(\"..ab ab.. .. abc..d\", \"abc..\");\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, strTempDir));\n-    }\n+                        break;\n+                    case '*':\n+                    case '?':\n+                        GetEntries(Directory.GetCurrentDirectory(), string.Format(\"te{0}st\", invalidFileNames[i].ToString()));\n+                        break;\n+                    default:\n+                        Assert.Throws<ArgumentException>(() => GetEntries(Directory.GetCurrentDirectory(), string.Format(\"te{0}st\", invalidFileNames[i].ToString())));\n+                        break;\n+                }\n+            }\n+        }\n \n-    [Fact]\n-    [PlatformSpecific(PlatformID.AnyUnix)]\n-    public void UnixFilePathWithSpaces()\n-    {\n-        Assert.Throws<ArgumentException>(() => GetEntries(\"\\0\"));\n-        using (File.Create(Path.Combine(TestDirectory, \" \")))\n-        using (File.Create(Path.Combine(TestDirectory, \"          \")))\n-        using (File.Create(Path.Combine(TestDirectory, \"\\n\")))\n+        [Fact]\n+        [PlatformSpecific(PlatformID.AnyUnix)]\n+        public void UnixSearchPatternInvalid()\n         {\n-            String[] results = GetEntries(TestDirectory);\n-            Assert.Contains(Path.Combine(TestDirectory, \" \"), results);\n-            Assert.Contains(Path.Combine(TestDirectory, \"          \"), results);\n-            Assert.Contains(Path.Combine(TestDirectory, \"\\n\"), results);\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \"\\0\"));\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, string.Format(\"te{0}st\", \"\\0\".ToString())));\n         }\n-    }\n \n-    [Fact]\n-    [PlatformSpecific(PlatformID.AnyUnix)]\n-    public void UnixSearchPatternWithSpaces()\n-    {\n-        Assert.Empty(GetEntries(TestDirectory, \"           \"));\n-        Assert.Empty(GetEntries(TestDirectory, \"\\n\"));\n-        Assert.Empty(GetEntries(TestDirectory, \" \"));\n-        Assert.Empty(GetEntries(TestDirectory, \"\"));\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \"\\0\"));\n-    }\n+        [Fact]\n+        [PlatformSpecific(PlatformID.Windows)]\n+        public void WindowsSearchPatternWildCharacters()\n+        {\n+            string strTempDir = Path.Combine(\"dls;d\", \"442349-0\", \"v443094(*)(+*$#$*\") + new string(Path.DirectorySeparatorChar, 3);\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, strTempDir));\n+        }\n \n-    [Fact]\n-    [PlatformSpecific(PlatformID.AnyUnix)]\n-    public void UnixSearchPatternWithDoubleDots()\n-    {\n-        // search pattern is valid but directory doesn't exist\n-        Assert.Throws<DirectoryNotFoundException>(() => GetEntries(TestDirectory, Path.Combine(\"..ab ab.. .. abc..d\", \"abc..\")));\n-\n-        // invalid search pattern trying to go up a directory with ..\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, Path.Combine(\"..ab ab.. .. abc..d\", \"abc\", \"..\")));\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, Path.Combine(\"..ab ab.. .. abc..d\", \"..\", \"abc\")));\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, Path.Combine(\"..\", \"..ab ab.. .. abc..d\", \"abc\")));\n-        Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, Path.Combine(\"..\", \"..ab ab.. .. abc..d\", \"abc\") + Path.DirectorySeparatorChar));\n-    }\n+        [Fact]\n+        [PlatformSpecific(PlatformID.Windows)]\n+        public void WindowsSearchPatternQuestionMarks()\n+        {\n+            string testDir1Str = GetTestFileName();\n+            string testDir11Str = GetTestFileName();\n+            DirectoryInfo testDir = new DirectoryInfo(TestDirectory);\n+            DirectoryInfo testDir1 = testDir.CreateSubdirectory(testDir1Str);\n+            testDir1.CreateSubdirectory(testDir11Str);\n \n-    #endregion\n-}\n+            using (File.Create(Path.Combine(TestDirectory, testDir1Str, testDir11Str, GetTestFileName())))\n+            using (File.Create(Path.Combine(TestDirectory, GetTestFileName())))\n+            {\n+                string[] results = GetEntries(TestDirectory, string.Format(\"{0}.???\", new string('?', GetTestFileName().Length)));\n+                if (TestFiles && TestDirectories)\n+                    Assert.Equal(2, results.Length);\n+                else\n+                    Assert.Equal(1, results.Length);\n+            }\n+        }\n+\n+        [Fact]\n+        [PlatformSpecific(PlatformID.Windows)]\n+        public void WindowsSearchPatternWhitespace()\n+        {\n+            Assert.Empty(GetEntries(TestDirectory, \"           \"));\n+            Assert.Empty(GetEntries(TestDirectory, \"\\n\"));\n+            Assert.Empty(GetEntries(TestDirectory, \" \"));\n+            Assert.Empty(GetEntries(TestDirectory, \"\\t\"));\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \"\\0\"));\n+            Assert.Throws<ArgumentException>(() => GetEntries(TestDirectory, \">\"));\n+        }\n \n+        [Fact]\n+        [PlatformSpecific(PlatformID.Linux)]\n+        public void SearchPatternCaseSensitive()\n+        {\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            string testBase = GetTestFileName();\n+            testDir.CreateSubdirectory(testBase + \"aBBb\");\n+            testDir.CreateSubdirectory(testBase + \"aBBB\");\n \n+            File.Create(Path.Combine(testDir.FullName, testBase + \"AAAA\")).Dispose();\n+            File.Create(Path.Combine(testDir.FullName, testBase + \"aAAa\")).Dispose();\n+            \n+            if (TestDirectories)\n+            {\n+                Assert.Equal(2, GetEntries(testDir.FullName, \"*BB*\").Length);\n+            }\n+            if (TestFiles)\n+            {\n+                Assert.Equal(2, GetEntries(testDir.FullName, \"*AA*\").Length);\n+\n+            }\n+        }\n+\n+        [Fact]\n+        [PlatformSpecific(PlatformID.Windows | PlatformID.OSX)]\n+        public void SearchPatternCaseInsensitive()\n+        {\n+            DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+            string testBase = GetTestFileName();\n+            testDir.CreateSubdirectory(testBase + \"aBBb\");\n+            testDir.CreateSubdirectory(testBase + \"aBBB\");\n+\n+            File.Create(Path.Combine(testDir.FullName, testBase + \"AAAA\")).Dispose();\n+            File.Create(Path.Combine(testDir.FullName, testBase + \"aAAa\")).Dispose();\n+\n+            if (TestDirectories)\n+            {\n+                Assert.Equal(1, GetEntries(testDir.FullName, \"*BB*\").Length);\n+            }\n+            if (TestFiles)\n+            {\n+                Assert.Equal(1, GetEntries(testDir.FullName, \"*AA*\").Length);\n+            }\n+        }\n+\n+        [Fact]\n+        [PlatformSpecific(PlatformID.AnyUnix)]\n+        [ActiveIssue(2205)]\n+        public void UnixSearchPatternFileWhitespace()\n+        {\n+            if (TestFiles)\n+            {\n+                DirectoryInfo testDir = Directory.CreateDirectory(GetTestFilePath());\n+                foreach (string whitespace in WhitespaceVariations)\n+                {\n+                    File.Create(Path.Combine(testDir.FullName, whitespace)).Dispose();\n+                }\n+\n+                foreach (string whitespace in WhitespaceVariations)\n+                    Assert.Contains(testDir.FullName + Path.DirectorySeparatorChar + whitespace, GetEntries(testDir.FullName, whitespace));\n+            }\n+        }\n+\n+        [Fact]\n+        [PlatformSpecific(PlatformID.AnyUnix)]\n+        [ActiveIssue(2205)]","path":"src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs","position":521,"original_position":521,"commit_id":"ff0aa35b0573a824557766adfabaf5ba855b93ea","original_commit_id":"ff0aa35b0573a824557766adfabaf5ba855b93ea","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"Why is this marked as an ActiveIssue?","created_at":"2015-07-09T02:41:19Z","updated_at":"2015-07-09T02:41:19Z","html_url":"https://github.com/dotnet/corefx/pull/2281#discussion_r34219568","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/2281","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/34219568"},"html":{"href":"https://github.com/dotnet/corefx/pull/2281#discussion_r34219568"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2281"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/2281","id":39534876,"html_url":"https://github.com/dotnet/corefx/pull/2281","diff_url":"https://github.com/dotnet/corefx/pull/2281.diff","patch_url":"https://github.com/dotnet/corefx/pull/2281.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/2281","number":2281,"state":"open","locked":false,"title":"FileSystem updates and test modernization to fix intermittent test failures and concurrency issues.","user":{"login":"ianhays","id":2606879,"avatar_url":"https://avatars.githubusercontent.com/u/2606879?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhays","html_url":"https://github.com/ianhays","followers_url":"https://api.github.com/users/ianhays/followers","following_url":"https://api.github.com/users/ianhays/following{/other_user}","gists_url":"https://api.github.com/users/ianhays/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhays/subscriptions","organizations_url":"https://api.github.com/users/ianhays/orgs","repos_url":"https://api.github.com/users/ianhays/repos","events_url":"https://api.github.com/users/ianhays/events{/privacy}","received_events_url":"https://api.github.com/users/ianhays/received_events","type":"User","site_admin":false},"body":"- System.IO.UnixFileSystem has an issue with the \"overwrite\" being interpreted backwards. I simply reversed the conditional statement to be correct. There were previously no tests to cover this possibility. Resolves #2276\r\n- Updated over a dozen test files to use the modern Xunit syntax.\r\n- Solved file-in-use concurrency issues in the altered tests. Resolves #1313, #2227\r\n- Tests will no longer intermittently fail.\r\n- Slightly improved code coverage for the FileSystem files whose tests I altered (Directory, DirectoryInfo, File, FileInfo)\r\n- Most tests altered now inherit from similar tests to consolidate the testing robustness into as few locations as possible. For example, Directory_GetFiles_str now inherits from Directory_GetFileSystemEntries_str since the tests for Directory_GetFiles_str were the exact same ones as in Directory_GetFileSystemEntries_str anyways.\r\n- All altered tests now use the System.IO.FileSystem.Tests namespace\r\n- Renamed the File_WriteAll_all class name/file name to File_WriteAllText.\r\n- I tested my changes on Windows overnight to verify that there is no more intermittent test failures. I didn't have to modify all of the files listed in #2227 to get them to pass; this concerns me but I found no way to replicate the errors I was receiving before. My guess would be that the tests in the files I didn't alter (e.g. File_WriteAll and File_ReadAll) used the same names as the tests I did alter but now that the tests I altered are changed they no longer share test file names and no longer fail as a result.\r\n- Re-added ActiveIssue #2205 to the Unix Whitespace tests and added more whitespace possibilities like tab.","created_at":"2015-07-08T23:34:56Z","updated_at":"2015-07-09T02:41:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54d3b1ee0b8a52043ed735a3db9000a39a899f8b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/2281/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/2281/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/2281/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/ff0aa35b0573a824557766adfabaf5ba855b93ea","head":{"label":"ianhays:master","ref":"master","sha":"ff0aa35b0573a824557766adfabaf5ba855b93ea","user":{"login":"ianhays","id":2606879,"avatar_url":"https://avatars.githubusercontent.com/u/2606879?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhays","html_url":"https://github.com/ianhays","followers_url":"https://api.github.com/users/ianhays/followers","following_url":"https://api.github.com/users/ianhays/following{/other_user}","gists_url":"https://api.github.com/users/ianhays/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhays/subscriptions","organizations_url":"https://api.github.com/users/ianhays/orgs","repos_url":"https://api.github.com/users/ianhays/repos","events_url":"https://api.github.com/users/ianhays/events{/privacy}","received_events_url":"https://api.github.com/users/ianhays/received_events","type":"User","site_admin":false},"repo":{"id":37934303,"name":"corefx","full_name":"ianhays/corefx","owner":{"login":"ianhays","id":2606879,"avatar_url":"https://avatars.githubusercontent.com/u/2606879?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhays","html_url":"https://github.com/ianhays","followers_url":"https://api.github.com/users/ianhays/followers","following_url":"https://api.github.com/users/ianhays/following{/other_user}","gists_url":"https://api.github.com/users/ianhays/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhays/subscriptions","organizations_url":"https://api.github.com/users/ianhays/orgs","repos_url":"https://api.github.com/users/ianhays/repos","events_url":"https://api.github.com/users/ianhays/events{/privacy}","received_events_url":"https://api.github.com/users/ianhays/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ianhays/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/ianhays/corefx","forks_url":"https://api.github.com/repos/ianhays/corefx/forks","keys_url":"https://api.github.com/repos/ianhays/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ianhays/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ianhays/corefx/teams","hooks_url":"https://api.github.com/repos/ianhays/corefx/hooks","issue_events_url":"https://api.github.com/repos/ianhays/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/ianhays/corefx/events","assignees_url":"https://api.github.com/repos/ianhays/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/ianhays/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/ianhays/corefx/tags","blobs_url":"https://api.github.com/repos/ianhays/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ianhays/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ianhays/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/ianhays/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ianhays/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/ianhays/corefx/languages","stargazers_url":"https://api.github.com/repos/ianhays/corefx/stargazers","contributors_url":"https://api.github.com/repos/ianhays/corefx/contributors","subscribers_url":"https://api.github.com/repos/ianhays/corefx/subscribers","subscription_url":"https://api.github.com/repos/ianhays/corefx/subscription","commits_url":"https://api.github.com/repos/ianhays/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/ianhays/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/ianhays/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/ianhays/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/ianhays/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/ianhays/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ianhays/corefx/merges","archive_url":"https://api.github.com/repos/ianhays/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ianhays/corefx/downloads","issues_url":"https://api.github.com/repos/ianhays/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/ianhays/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/ianhays/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/ianhays/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ianhays/corefx/labels{/name}","releases_url":"https://api.github.com/repos/ianhays/corefx/releases{/id}","created_at":"2015-06-23T17:36:59Z","updated_at":"2015-06-23T17:37:18Z","pushed_at":"2015-07-08T23:23:09Z","git_url":"git://github.com/ianhays/corefx.git","ssh_url":"git@github.com:ianhays/corefx.git","clone_url":"https://github.com/ianhays/corefx.git","svn_url":"https://github.com/ianhays/corefx","homepage":"http://dotnet.github.io/core/","size":23475,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"89dd4fafeec3146708f6702d78219591b2bb31a6","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-07-08T22:51:24Z","pushed_at":"2015-07-09T01:55:43Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"http://dotnet.github.io/core/","size":49824,"stargazers_count":8017,"watchers_count":8017,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1658,"mirror_url":null,"open_issues_count":461,"forks":1658,"open_issues":461,"watchers":8017,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2281"},"html":{"href":"https://github.com/dotnet/corefx/pull/2281"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/2281"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/2281/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2281/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2281/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/ff0aa35b0573a824557766adfabaf5ba855b93ea"}}}}