You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are the situations below, extracted from the package tests, correct? expect(context.setExtension(r'a\b\', '.x'), r'a\b\.x'); -> given the path a\b\.x, the .x is not an extension in the sense that was defined by the extension function of this package. expect(context.setExtension(r'a\.', '.x'), r'a\..x'); -> Isn't the path a\. equivalent to the path a?
The description of the extension function is clear about a leading . not counting as starting an extension, so /.x.y has only one extension (.y), and .x will always be a base name.
It seems that multiple leading .s behave the the same way, so extension('..txt') is also an empty string, like extension('.txt') is documented as being. That's probably intentional.
It seems the package does not try to normalize path.ext/./ into path.ext/ first, it just tries to find an extension in ., which starts with a ., so that's an empty extension.
I don't know if it intends to normalize paths, so maybe that's working as intended. It does ignore any number of trailing /s.
Might have to call normalize to be sure that there are no trailing /.s.
I'm not sure this isn't all working as intended. It's definitely within reason.
The setExtension seems somewhat consistent with that behavior, except that it it's probably bugged.
print(p.setExtension('a.b/', '.x')); // a/.x
This recognizes and removes the .b as the extension, but puts the replacement after the /. That's probably not intended.
The function extension does not properly extract multiple levels of paths started with dot (.). The following examples does not work:
Extra: (the complete set of tests used):
The text was updated successfully, but these errors were encountered: