From d958e419eb484ef16cb75eb54c605e367491e07c Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Wed, 13 Jun 2018 15:19:05 -0700 Subject: [PATCH 1/2] Tests for #30263 fix Goes with https://github.com/dotnet/coreclr/pull/18460 --- .../tests/System/IO/Path.GetRelativePath.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs b/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs index 36a03d6bfc9f..e6460fd1dda5 100644 --- a/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs +++ b/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs @@ -17,6 +17,18 @@ public static class GetRelativePathTests [InlineData(@"C:\", @"C:\b", @"b")] [InlineData(@"C:\a", @"C:\b", @"..\b")] [InlineData(@"C:\a", @"C:\b\", @"..\b\")] + [InlineData(@"C:\a\b", @"C:\a", @"..")] + [InlineData(@"C:\a\b", @"C:\a\", @"..")] + [InlineData(@"C:\a\b\", @"C:\a", @"..")] + [InlineData(@"C:\a\b\", @"C:\a\", @"..")] + [InlineData(@"C:\a\b\c", @"C:\a\b", @"..")] + [InlineData(@"C:\a\b\c", @"C:\a\b\", @"..")] + [InlineData(@"C:\a\b\c", @"C:\a", @"..\..")] + [InlineData(@"C:\a\b\c", @"C:\a\", @"..\..")] + [InlineData(@"C:\a\b\c\", @"C:\a\b", @"..")] + [InlineData(@"C:\a\b\c\", @"C:\a\b\", @"..")] + [InlineData(@"C:\a\b\c\", @"C:\a", @"..\..")] + [InlineData(@"C:\a\b\c\", @"C:\a\", @"..\..")] [InlineData(@"C:\a\", @"C:\b", @"..\b")] [InlineData(@"C:\a", @"C:\a\b", @"b")] [InlineData(@"C:\a", @"C:\A\b", @"b")] From 0e157f46c9b06ffce5ae3d62deeec2a75928436b Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Thu, 14 Jun 2018 13:38:01 -0700 Subject: [PATCH 2/2] Add case for `C:\` to `D:\` --- .../tests/System/IO/Path.GetRelativePath.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs b/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs index e6460fd1dda5..3f48bfd9ccb5 100644 --- a/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs +++ b/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs @@ -34,7 +34,9 @@ public static class GetRelativePathTests [InlineData(@"C:\a", @"C:\A\b", @"b")] [InlineData(@"C:\a", @"C:\b\c", @"..\b\c")] [InlineData(@"C:\a\", @"C:\a\b", @"b")] + [InlineData(@"C:\", @"D:\", @"D:\")] [InlineData(@"C:\", @"D:\b", @"D:\b")] + [InlineData(@"C:\", @"D:\b\", @"D:\b\")] [InlineData(@"C:\a", @"D:\b", @"D:\b")] [InlineData(@"C:\a\", @"D:\b", @"D:\b")] [InlineData(@"C:\ab", @"C:\a", @"..\a")]