Skip to content

Commit

Permalink
(#16, #17, #18, #19, #20) Process the TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Apr 21, 2024
1 parent e1c8cf7 commit 6d8bf5f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Types
-----
The library offers several struct (i.e. low to zero memory overhead) types wrapping path strings. The types are designed to not involve any disk IO operations by default, and thus provide excellent performance during common operations. This comes with a drawback, though: **path comparison is only performed as string comparison so far**, which means that the library doesn't provide any means to compare paths in a case-insensitive way.

This is a subject to change in future releases, where we will provide more control over this: better platform-wide defaults (such as case-insensitive comparison on Windows and macOS), and options to enable more IO-intensive comparison (to check sensitivity settings of particular file path components during comparison). <!-- TODO: Open an issue on this -->
This is a subject to change in future releases, where we will provide more control over this: better platform-wide defaults (such as case-insensitive comparison on Windows and macOS), and options to enable more IO-intensive comparison (to check sensitivity settings of particular file path components during comparison). See [issue #20][issue.20] on the current progress on this change.

The paths are stored in the **normalized form**.

Expand Down Expand Up @@ -58,6 +58,7 @@ You are welcome to explicitly state your copyright in the file's header as descr
[docs.contributing]: CONTRIBUTING.md
[docs.maintaining]: MAINTAINING.md
[file-system-globbing.nuget]: https://www.nuget.org/packages/Microsoft.Extensions.FileSystemGlobbing
[issue.20]: https://github.com/ForNeVeR/TruePath/issues/20
[nuget.badge]: https://img.shields.io/nuget/v/TruePath
[nuget.page]: https://www.nuget.org/packages/TruePath
[reuse.spec]: https://reuse.software/spec/
Expand Down
2 changes: 1 addition & 1 deletion TruePath.Tests/PathStringsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void DotFoldersAreTraversed(string input, string expected)
Assert.Equal(NormalizeSeparators(expected), PathStrings.Normalize(input));
}

[Theory(Skip = "TODO[36]: Make it work properly")]
[Theory(Skip = "TODO[#16]: Make it work properly")]
[InlineData("C:.", "C:")]
[InlineData("C:./foo", "C:foo")]
[InlineData("C:..", "C:..")]
Expand Down
2 changes: 1 addition & 1 deletion TruePath/AbsolutePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AbsolutePath(string value)

/// <summary>The parent of this path. Will be <c>null</c> for a rooted absolute path.</summary>
public AbsolutePath? Parent => _underlying.Parent is { } path ? new(path.Value) : null;
// TODO[#36]: Optimize, the strict check here is not necessary.
// TODO[#17]: Optimize, the strict check here is not necessary.

/// <summary>The full name of the last component of this path.</summary>
public string FileName => _underlying.FileName;
Expand Down
1 change: 0 additions & 1 deletion TruePath/LocalPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public readonly struct LocalPath(string value)
/// The parent of this path. Will be <c>null</c> for a rooted absolute path, or relative path pointing to the
/// current directory.
/// </summary>
// TODO: Add tests for parent of `.` and `""` and `..`: what should they be actually?
public LocalPath? Parent => Path.GetDirectoryName(Value) is { } parent ? new(parent) : null;

/// <summary>The full name of the last component of this path.</summary>
Expand Down
2 changes: 1 addition & 1 deletion TruePath/PathStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class PathStrings
/// </summary>
public static string Normalize(string path)
{
// TODO[36]: Optimize this. It is possible to do with less allocations.
// TODO[#19]: Optimize this. It is possible to do with less allocations.
var segments = new List<(int Start, int End)>();

int? currentSegmentStart = 0;
Expand Down

0 comments on commit 6d8bf5f

Please sign in to comment.