* Handle escaping in Unix file enumeration
We try and align with Windows, so we'll escape out [ and /.
Adds a bunch of tests and issues for other cases that we don't
match Windows behavior.
* Clarify comments, move one case
For completeness I ran everything through RtlIsNameInExpression to
validate the "correct" results. I've commented appropriately.
I moved one test to the "normal" block that I misplaced.
* Optimize the escaping a bit
* Improve perf further
* Whoops, miscopied
* More feedback
Commit migrated from https://github.com/dotnet/corefx/commit/059eec8df974867d773178d5553ca15a487a2e45
* Fill out FileSystemInfo state when enumerating
On Windows FileSystemInfos are filled in with state as we have
all of the state from FindFirstFileEx.
* Add more tests
Refactor Time tests and add cases for refresh state.
Fix positive attribute assertion.
* Missed one of the cases
* Tweaking the time tolerance didn't succeed.
Putting it back to -3 seconds.
* Refactor tests
Gets coverage consistent
Fixes test bug in DirectoryInfo where it was creating files for invalid attributes
* Address feedback
Commit migrated from https://github.com/dotnet/corefx/commit/9468aedba81b7d0b43f5545fc840a53544164694
* Fix Unix missing file state
In the original .NET implementation a missing file never
throws directly with FileInfo. Attributes get the error result
from Windows (-1) and times aren't initialized.
* Feedback
* Change FileSystemTest derivation
FileSystemTest should derive from RemoteFileSystemTest so
we can have one base class.
* Add RemoteExecutorBase to performance test project
* Address test feedback
* Fix File.GetAttributes on Unix
NetFX doesn't rely on FileInfo and throws when getting attributes
on missing files through File.
Commit migrated from https://github.com/dotnet/corefx/commit/801dde95a5eac06140d0ac633ac3f9bfdd25aca5
* Remove SerializableAttribute from many CoreFX types that will not be serializable.
* Removes serialization tests for types that are no longer serializable and fixes serializing a couple of types. Includes marking some internal serializable types as public so that they'll be reflectible with .NET Native.
* Remove unneeded pragmas
* Update based on review comments
Commit migrated from https://github.com/dotnet/corefx/commit/6dd451f51451a7d0ceea6104b51bd17005e9a0e6
* Fix using Directory to move files
See dotnet/corefx#19710. NetFX behavior is that you can use Directory
to move files. This was broken trying to match other legacy
behavior in dotnet/corefx#17913. Tested on NetFX and CoreFX.
* Fix check for Unix
Unix impl doesn't tolerate a trailing separator. Public api
explicitly checks for this.
* More fixes and tests
Unix won't move the file with a trailing slash. Add more tests
for different combinations of trailing slashes. Validated against
NetFX.
* Attempt to get MoveDirectory further aligned
Trying to handle trailing separator on a source file cases
in the same way as Windows.
* Extend tests, move Unix condition
* Another tweak and more tests
* Fix comment
Commit migrated from https://github.com/dotnet/corefx/commit/ea514e2f4e61bd3128ea3753071af2681f17f063
The FileShareOpen test has been failing sporadically with sharing violations. It turns out the problem has to do with FileShare.Inheritable being included in the list of FileShare values to test. If another test in the same process concurrently spawns a process while a FileShare.Inheritable file is open, that file's handle will be inherited into the child process, which will in turn keep the file in use for longer than the test expects. When it then tries to re-open the file, it may encounter a sharing violation if the subsequent open is incompatible with the previous one's FileShare.
Commit migrated from https://github.com/dotnet/corefx/commit/041672ff3642753807a4502a4c407cb82bfa1009
In some of our test suites, we use a pattern where a base class contains the core test logic and then derived classes override various members in those base classes to customize the actual tests. xunit then runs the base methods for each of the derived types.
Since xunit by default parallelizes inter-class, meaning it won't parallelize tests on the same class but will on different classes, tests on the base class may run in parallel with themselves, though, when actually being run for different concrete derived types. This is problematic when the tests pick temporary file names based on the test itself, e.g. using the FileCleanupTestBase helper that derives a temporary file name from the current member name, line number, etc.
To avoid such conflicts, this changes adds a random identifier into each such temporary file name.
Commit migrated from https://github.com/dotnet/corefx/commit/8c16d26d42c3aa81b28e4aeb790a821bd67c03b8
We currently consider a file to be hidden if its name starts with a period. That applies to directories as well. But if the directory name in the FileSystemInfo ends with a '/', then the file name that comes back from GetFileName is empty, and it's actually the GetDirectoryName value we want to check for a period.
Commit migrated from https://github.com/dotnet/corefx/commit/de10647c8f3cb4190653bf243c515d3431689004
* Uri: detect Unix path on Unix, detect Dos&Unc path on Windows
* Update System.IO.Packaging/tests
* Update System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests
* Update Common.Tests
* Update System.Private.Uri.Functional.Tests
* Update System.Private.Uri.ExtendedFunctional.Tests
* Update System.Runtime/tests
* Uri.MethodsTests.cs: comment out failing inputs
* Restore uri minimal length of 3
* Require unix paths to start with a /
* Allow Unix path file uri to start with '\'
* FileWebRequestTest: revert extra slashes added (file:/// back to file://)
* Uri: fix empty newHost bug and revert workaround in IriTest
* Annotate PlatformSpecific tests
* IdentityHelperTests: use file path that works on Windows and Linux
* System.IO.Packaging/tests: rename s_LocalFile to s_fullPathToLocalFile
* Uri: update comments on minimal Uri length check, don't check length twice on Windows
* Use PlatformDetection.IsWindows
* Ensure Roslyn gets rid of UnixPath checks on Windows by adding IsWindowsSystem (const bool) checks
* Uri: Fix uapaot build by including Uri.Windows.cs
* IdentityHelperTests: rename GetNormalizedUrlHash_Unix -> GetNormalizedUrlHash
* Uri.MethodsTests: don't require GetHashCode to return different values when Uris only differ in case
* s_IsWindowsSystem -> s_isWindowsSystem
* Detect Dos and Unc paths on Unix
* Update tests
* Clean-up
* Clean-up II
* Clean-up III
* Clean-up IV
* Clean-up V
* Move Flags.UnixPath to the end of the Flags enum
Commit migrated from https://github.com/dotnet/corefx/commit/7df6b74cc4aeebc86e76b5c7901a59fa7fa793f6
Update the csproj files of all of the performance tests to reference the
PerfRunner csproj. Also make a change to the PerfRunner csproj to mark
it as a test project so that it can use the generated test runtime for
dependency resolution.
Commit migrated from https://github.com/dotnet/corefx/commit/495e4e8dbdeb0fbe904c323a0ac83f630d44bc8d