PathBase<T>.Up(1) has bug?

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start at PathBase.Up(1) and reproduce the two C# examples from the issue using paths with and without a trailing backslash. The work is done when both calls produce the same FullPath, matching the expected parent-path behavior described in the issue.

Written by the indexing model from the issue text.

Description

It looks like there is small bug or feature in this method.
When the path is directory ends with '' character then .Up(1) just remove this character.
And I think that the purpose of this method is to do the same what "../" does in CMD.

var example1 = Fluent.IO.Path.Get("C:\\aaa\\bbb\\").Up(1).FullPath;
var example2 = Fluent.IO.Path.Get("C:\\aaa\\bbb").Up(1).FullPath;
Debug.Assert(example1 == example2);

In my opinion:
"C:\aaa\bbb\" and "C:\aaa\bbb" are not the same string
but are the same path.

Dominant language
C#
Stars
83
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bleroy/FluentPath

All issues in bleroy/FluentPath

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.