Skip to content

[NSString] Add implementation of intValue and tests #85

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
Dec 9, 2015
Merged

[NSString] Add implementation of intValue and tests #85

merged 1 commit into from
Dec 9, 2015

Conversation

thii
Copy link
Contributor

@thii thii commented Dec 8, 2015

No description provided.

@@ -457,7 +457,10 @@ extension NSString {

public var intValue: Int32 {
get {
NSUnimplemented()
let scanner = NSScanner(string: _swiftObject)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the experimental API currently implemented, this could just be one line: return NSScanner(string: _swiftObject).scanInt() ?? 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'm rebasing this and #86 now.

@hartbit
Copy link
Contributor

hartbit commented Dec 8, 2015

Perhaps add a test to validate the 0/failing path?

@thii
Copy link
Contributor Author

thii commented Dec 9, 2015

@hartbit I think there is no need since test_integerValue() contains most of similar tests and the logic is the same.

@hartbit
Copy link
Contributor

hartbit commented Dec 9, 2015

I still think this is useful. You never know when someone in the future might change the implementation of the two methods independently.

@phausler phausler merged commit 257172d into swiftlang:master Dec 9, 2015
@thii
Copy link
Contributor Author

thii commented Dec 9, 2015

Will add more tests in another PR.

@thii thii deleted the nsstring-intvalue branch December 9, 2015 17:10
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
Undo optimisim around requiring clangd during testing
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Apr 29, 2021
…and-python3

Update the linux_load_command.py to support python3
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
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.

4 participants