Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@ -30,6 +30,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
@ -43,7 +44,7 @@ namespace MonoTests.System.IO
[Test]
public void Constructor ()
{
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
if (!RuntimeInformation.IsOSPlatform (OSPlatform.Windows))
Assert.Ignore ("The Jenkins builders don't have '/' mounted, just testing Windows for now.");
var drive = new DriveInfo ("C:\\");
@ -54,7 +55,22 @@ namespace MonoTests.System.IO
[Test]
public void ConstructorThrowsOnNonExistingDrive ()
{
Assert.Throws<ArgumentException> (() => new DriveInfo ("/monodriveinfotest"));
Assert.Throws<ArgumentException> (() => new DriveInfo ("monodriveinfotest"));
}
[Test]
[Category ("NotWasm")] // it doesn't know about 'memfs' drive format
public void ConstructorGetsValidDriveFromNonDriveString ()
{
if (!RuntimeInformation.IsOSPlatform (OSPlatform.Windows) && !RuntimeInformation.IsOSPlatform (OSPlatform.OSX))
Assert.Ignore ("Some Linux-hosted CI builders don't have '/' mounted, just testing Windows and MacOS for now.");
var tempPath = Path.GetTempPath ();
var drive = new DriveInfo (tempPath);
ValidateDriveInfo (drive);
drive = new DriveInfo (tempPath.ToUpper());
ValidateDriveInfo (drive);
}
[Test]