Skip to content

Commit

Permalink
Change exception throwing in Path.GetRelativePath (dotnet/corefx#38388)
Browse files Browse the repository at this point in the history
* Fix Path.GetRelativePath throws ArgumentNullException when relativeTo is empty string

* Code review fixes


Commit migrated from dotnet/corefx@249b512
  • Loading branch information
Marusyk authored and danmoseley committed Aug 2, 2019
1 parent 6667b84 commit 7c7dcb1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,12 @@ public static void GetRelativePath_Mac(string relativeTo, string path, string ex
ignoreLineEndingDifferences: false,
ignoreWhiteSpaceDifferences: false);
}

[Fact]
public static void GetRelativePath_InvalidArgs()
{
AssertExtensions.Throws<ArgumentNullException>("relativeTo", null, () => Path.GetRelativePath(null, "."));
AssertExtensions.Throws<ArgumentException>("relativeTo", null, () => Path.GetRelativePath(string.Empty, "."));
}
}
}

0 comments on commit 7c7dcb1

Please sign in to comment.