-
Notifications
You must be signed in to change notification settings - Fork 45
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
relative() returns incorrect result #12
Comments
This looks correct to me. It satisfies the invariant that import 'package:path/path.dart' as p;
void main() {
var from = "/var/folders/00/0w978000h01000cxqpysvccm003j4x/T/flutter_toolsZUIVMq";
var path = "/Users/devoncarew/projects/flutter/flutter/packages";
print(p.normalize(from, p.join(p.relative(path, from: from))));
// => /Users/devoncarew/projects/flutter/flutter/packages
} Keep in mind that the |
|
In that case, the path you listed should work. I count six |
But from What's odd is that this test works on linux. And it does look like the relative path being created in the pubspec is bad. |
Not if it's a directory and you're resolving a path inside it. You still have to
I suspect the real issue here is OS X's symlinking of the |
Ah, something to look into. I'll see if canonicalizing the paths helps. |
We're seeing a failure in flutter's tests (flutter/flutter#1709) which looks like a bug in path's
relative()
function:The relative result isn't correct. It's off by one in the number of times it should traverse up to the parent directory. From
flutter_toolsZUIVMq
it can only go up 5 times to/
, but it has 6..
's in the relative result.The text was updated successfully, but these errors were encountered: