-
Notifications
You must be signed in to change notification settings - Fork 354
[lldb][windows] add NSDate and FoundationEssentials.Date dataformatters #11948
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| SWIFT_SOURCES := main.swift | ||
|
|
||
| include Makefile.rules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| """ | ||
| Test Foundation.Date summary strings. | ||
| """ | ||
|
|
||
| import lldb | ||
| from lldbsuite.test.lldbtest import * | ||
| from lldbsuite.test.decorators import * | ||
| import lldbsuite.test.lldbutil as lldbutil | ||
|
|
||
| import sys | ||
|
|
||
|
|
||
| class TestCase(TestBase): | ||
| @skipUnlessFoundation | ||
| @swiftTest | ||
| def test_swift_date_formatters(self): | ||
| """Test Date summary strings.""" | ||
| self.build() | ||
|
|
||
| _ = lldbutil.run_to_source_breakpoint( | ||
| self, "break here", lldb.SBFileSpec("main.swift") | ||
| ) | ||
|
|
||
| self.expect( | ||
| "v date", | ||
|
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. Nit (for the future): I think it's better to spell out "frame variable" instead of "v". We've changed aliases in the past so it could happen again, it's also easier to grep
Author
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. Thanks! I opened #12005 as a follow up. |
||
| startstr="(Foundation.Date) date = 2001-01-15 13:12:00 UTC", | ||
| ) | ||
|
|
||
| if sys.platform != "win32": | ||
| return | ||
|
|
||
| self.expect( | ||
| "v nsdate", | ||
| startstr="(Foundation.NSDate) date = 2001-01-15 13:12:00 UTC", | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import Foundation | ||
|
|
||
| let paris = TimeZone(identifier: "Europe/Paris")! | ||
|
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. Nit: it would be better to put this code in a
Author
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. Thanks! I opened #12005 as a follow up. |
||
|
|
||
| var comps = DateComponents() | ||
| comps.year = 2001 | ||
| comps.month = 1 | ||
| comps.day = 15 | ||
| comps.hour = 14 | ||
| comps.minute = 12 | ||
| comps.timeZone = paris | ||
|
|
||
| let date = Calendar(identifier: .gregorian).date(from: comps)! | ||
| let nsdate = date as NSDate | ||
|
|
||
| print("break here") | ||
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.
This will match:
Foundation.DateFoundationEssentials.DateFoundation.NSDateThis should not clash with the other
Foundation.NSDateformatter. The tests should confirm this.