-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[SR-10574] Add tests for new Japanese calendar era name #2200
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
[SR-10574] Add tests for new Japanese calendar era name #2200
Conversation
@swift-ci test |
Reiwa(令和) era has just begun 😄. |
// format test | ||
let dateString = formatter.string(from: Date(timeIntervalSince1970: 1556633400)) // April 30, 2019, 11:10 PM (JST) | ||
XCTAssertEqual(dateString, "平成31年4月30日 23:10") | ||
// Disabled until the ICU is updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you enable these tests please. I just want to check they fail with the current ICU so then they pass with the new ICU we know its all working correctly, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spevans This following codes require ICU 64.2. It should be enabled?
And if the ICU is 64.2, L448-L457 will fail. This lines for ICU 61.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot commit tests that fail.
If you want, you can replace the do
block with if shouldAttemptXFailTests("These tests require ICU 64.2 or later. https://bugs.swift.org/browse/SR-XXXX") { … }
where the XXXX link is a bug filed on bugs.swift.org to migrate to newer ICU. @spevans, you can then run this test by setting the environment variable NS_FOUNDATION_ATTEMPT_XFAIL_TESTS
to YES
.
TestFoundation/TestCalendar.swift
Outdated
do { | ||
let date = Date(timeIntervalSince1970: 1556633400) // April 30, 2019 | ||
let components = calendar.dateComponents([.era, .year, .month, .day], from: date) | ||
XCTAssertEqual(calendar.eraSymbols[components.era!], "Heisei") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this assuming a particular current locale?
This is to be tested with swiftlang/swift#24387 |
I fixed some lines of the test.
Is it okay? Would we these commits combine into a single commit? |
Yes, if you could, can rebase squash them into one commit, thanks. |
ae737c1
to
70d8d97
Compare
It seems to be okay. |
@swift-ci test |
@swift-ci please test |
Please test with the following pull request: @swift-ci test linux |
@ianpartridge It looks like the CI isnt pulling in the new version of ICU when doing |
Yeah I'm not sure there is one. It looks like it decides which release of ICU to use before it looks at my PR :( Maybe we'll have to merge then test? |
@shahmishal Can you look into why CI isn't pulling the new updated ICU from the associated Swift PR? |
Please test with the following pull request: @swift-ci test linux |
The test crashes on something related CF and Foundation bridges. |
I found that import Foundation
let cal = Calendar(identifier: .gregorian)
cal.eraSymbols |
@novi, could you open a bug for that issue please. The actual error for it is:
Caused by this line in
Thanks |
@YOCKOW Thanks. That's great. @spevans @millenomi Could we test this pull request again? |
@swift-ci test |
@ianpartridge Thanks. Would it be tested with swiftlang/swift#24387 ? |
@swift-ci Please test |
It seems to be not tested with swiftlang/swift#24387. Would it be tested with that? |
@swift-ci Please test with the following pull request |
Thanks, but the latest testing is 15 days ago. Could we have any ideas? |
@swift-ci test linux |
@novi Now that ICU has been updated to 65.1 in swiftlang/swift#27937 if you could update this test to use |
70d8d97
to
e0cc72e
Compare
@spevans The tests is updated for ICU 65.1. (A branch name of my fork includes 61.2, but we could merge this PR anyway.) |
@swift-ci test |
Could you merge this pull request? I would update to resolve this conflicts before merge. |
Yes please rebase it and then it can be merged. ICU has been updated to 65.1 now so the tests should now pass. |
e0cc72e
to
dde1c44
Compare
@spevans Thanks. I have rebased it and the base is up to date. |
TestFoundation/TestCalendar.swift
Outdated
@@ -111,6 +111,31 @@ class TestCalendar: XCTestCase { | |||
XCTAssertEqual(components.day, 18) | |||
|
|||
} | |||
|
|||
func test_gettingDatesOnJapaneseCalendar() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to add this test into the list of tests at the end of the file, Linux and TestFoundation doesnt automatically pick up tests as happens on macOS. If you can squash that change in we can get this merged, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spevans Sure. Fixed it. Now, It seems be okay.
dde1c44
to
ddeeecb
Compare
@swift-ci test and merge |
- Add Calendar test - Add DateFormatter test
ddeeecb
to
0bfcda9
Compare
@spevans Hello, will it be tested? I have resolved the conflicts. |
@swift-ci test linux |
Test Calendar and DateFormatter with new era name (SR-10574).
Related swiftlang/swift#24387.