Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ignore the test.settings.json as it should reflect the individual developer experience.
# > https://github.com/Testably/Testably.Abstractions/blob/main/CONTRIBUTING.md#tests
/test.settings.json
/Tests/test.settings.json

# Set up Visual Studio to use WSL to execute unit tests in Ubuntu:
# https://learn.microsoft.com/en-us/visualstudio/test/remote-testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public override string GetFullPath(string path)
string candidate;
if (!string.IsNullOrEmpty(pathRoot) && !string.IsNullOrEmpty(directoryRoot))
{
if (char.ToUpperInvariant(pathRoot[0]) != char.ToUpperInvariant(directoryRoot[0]))
if (pathRoot[0] == DirectorySeparatorChar && pathRoot.Length == 1)
{
candidate = directoryRoot + path.Substring(1);
}
else if (char.ToUpperInvariant(pathRoot[0]) != char.ToUpperInvariant(directoryRoot[0]))
{
candidate = path;
}
Expand Down
1 change: 1 addition & 0 deletions Testably.Abstractions.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/IsNotificationDisabled/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OS/@EntryIndexedValue">OS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UNC/@EntryIndexedValue">UNC</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ public void Exists_File_ShouldReturnFalse(string path)
result.Should().BeFalse();
}

[Fact]
public void Exists_ForwardSlash_ShouldReturnTrue()
{
FileSystem.InitializeIn("D:");

bool result = FileSystem.Directory.Exists("/");

result.Should().BeTrue();
}

[Fact]
public void Exists_ForwardSlashWithDirectory_ShouldReturnTrue()
{
FileSystem.Directory.CreateDirectory("/tmp");

bool result = FileSystem.Directory.Exists("/tmp");

result.Should().BeTrue();
}

[Theory]
[InlineData(@"\\s")]
[InlineData("<")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public void Exists_File_ShouldReturnFalse(string path)
sut.Exists.Should().BeFalse();
}

[Fact]
public void Exists_ForwardSlash_ShouldReturnTrue()
{
FileSystem.InitializeIn("D:");

IDirectoryInfo sut = FileSystem.DirectoryInfo.New("/");

sut.Exists.Should().BeTrue();
}

[Theory]
[AutoData]
public void Exists_NotExistedPreviously_ShouldOnlyUpdateOnInitialization(string path)
Expand Down
Loading