Skip to content

[android] Fix tilde/home directory tests. #2144

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

Merged
merged 1 commit into from
Apr 22, 2019

Conversation

drodriguez
Copy link
Contributor

In Android, the home directory is the root directory. Foundation returns
the right one, but the tests where checking against having a final
trailing slash, which is not true if the home directory is the root
directory.

The change adds an extra check to avoid the failure in case the
resulting tilde expansion is just the root directory. The comment
explains why the change is needed.

Additionally, instead of using + to add two strings,
appendingPathComponent is used to build an expected value from the
result of NSHomeDirectory(), in order to deal with cases where the
NSHomeDirectory() has a trailing slash.

In Android, the home directory is the root directory. Foundation returns
the right one, but the tests where checking against having a final
trailing slash, which is not true if the home directory is the root
directory.

The change adds an extra check to avoid the failure in case the
resulting tilde expansion is just the root directory. The comment
explains why the change is needed.

Additionally, instead of using `+` to add two strings,
`appendingPathComponent` is used to build an expected value from the
result of `NSHomeDirectory()`, in order to deal with cases where the
`NSHomeDirectory()` has a trailing slash.
@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi millenomi merged commit 2750737 into swiftlang:master Apr 22, 2019
@drodriguez drodriguez deleted the android-fix-tilde-test branch July 16, 2019 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants