-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dirname
returns wrong result When the path is the root
#3782
Comments
After running the assert.strictEqual(path.posix.dirname("////"), "/");
assert.strictEqual(path.posix.dirname("//a"), "//");
assert.strictEqual(path.win32.dirname("c:\\"), "c:\\");
assert.strictEqual(path.win32.dirname("\\"), "\\");
assert.strictEqual(path.win32.dirname("c:"), "c:");
assert.strictEqual(path.win32.dirname("c:foo"), "c:");
assert.strictEqual(path.win32.dirname("c:foo\\"), "c:");
assert.strictEqual(path.win32.dirname("\\\\unc\\share"), "\\\\unc\\share");
assert.strictEqual(path.win32.dirname("/"), "/");
assert.strictEqual(path.win32.dirname("////"), "/"); Ref: https://github.com/nodejs/node/blob/main/test/parallel/test-path-dirname.js |
I’m surprised we still have these bugs |
I think i can fix this. |
Please do |
Hanaasagi
added a commit
to Hanaasagi/bun
that referenced
this issue
Jul 24, 2023
Jarred-Sumner
pushed a commit
that referenced
this issue
Jul 25, 2023
This was referenced Sep 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Bun is running?
0.7.0
What platform is your computer?
Linux 6.4.4-arch1-1 x86_64 unknown
What steps can reproduce the bug?
What is the expected behavior?
No `AssertionError``.
What do you see instead?
Additional information
I think this bug is related to #2676
Here, the returned value should be determined by more context details instead of returning a
.
.bun/src/bun.js/node/types.zig
Lines 1699 to 1702 in 967ccb5
The text was updated successfully, but these errors were encountered: