-
Notifications
You must be signed in to change notification settings - Fork 193
[Android] Enable more code and tests #871
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,7 @@ struct TimeZoneCache : Sendable, ~Copyable { | |
} | ||
} | ||
|
||
#if os(Linux) && !os(WASI) | ||
#if os(Linux) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kateinoigakukun, I assume the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, just a |
||
// Try localtime | ||
tzset() | ||
var t = time(nil) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,10 @@ import TestSupport | |
@testable import Foundation | ||
#endif | ||
|
||
#if canImport(Android) | ||
import Android | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious why we need this import here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the compilation error I get without it:
There are some strange issues with these platform overlays, which I investigated a bit last month. Since nobody I asked seems to have a good idea of what's going on, I chalked it up to some Swift module leak that can be fixed later and am just adding these imports now to shut the compiler up. |
||
|
||
extension FileManager { | ||
fileprivate var delegateCaptures: DelegateCaptures { | ||
(self.delegate as! CapturingFileManagerDelegate).captures | ||
|
@@ -337,8 +341,13 @@ final class FileManagerTests : XCTestCase { | |
XCTAssertTrue($0.delegateCaptures.isEmpty) | ||
try $0.linkItem(atPath: "foo", toPath: "bar") | ||
XCTAssertEqual($0.delegateCaptures.shouldLink, [.init("foo", "bar")]) | ||
#if os(Android) // Hard links are not normally allowed on Android. | ||
XCTAssertEqual($0.delegateCaptures.shouldProceedAfterLinkError, [.init("foo", "bar", code: .fileWriteNoPermission)]) | ||
XCTAssertFalse($0.fileExists(atPath: "bar")) | ||
#else | ||
XCTAssertEqual($0.delegateCaptures.shouldProceedAfterLinkError, []) | ||
XCTAssertTrue($0.fileExists(atPath: "bar")) | ||
#endif | ||
} | ||
|
||
try FileManagerPlayground { | ||
|
Uh oh!
There was an error while loading. Please reload this page.