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
implement NSString.boolValue #51
Conversation
@@ -34,6 +35,17 @@ class TestNSString : XCTestCase { | |||
("test_FromMalformedNullTerminatedCStringInUTF8", test_FromMalformedNullTerminatedCStringInUTF8 ), | |||
] | |||
} | |||
|
|||
func test_boolValue() { | |||
let trueStrings: [NSString] = ["t", "true", "TRUE", "tRuE", "yes", "YES", "1"] |
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.
the value "+000009" should map to true
The NSString documentation says:
It looks like, instead of checking the prefix for each character, it walks the string and checks if any of the characters match the predicates. |
Thanks for the tip @harlanhaskins! This one's on me, I should have referred to the documentation. |
I have an implementation in place, but I also had to implement |
c4485db
to
793f59b
Compare
This has been updated to address @phausler's feedback and abide by the documentation referred to by @harlanhaskins. This depends on #75. |
Looks great! 👍 |
793f59b
to
fbafb3f
Compare
fbafb3f
to
1f1bcc5
Compare
Now that #75 has been merged, I've dropped that commit from this branch, so now this just has the |
Thanks! |
[readme] Describe where toolchains are usually found on macOS/linux
[pull] swiftwasm from master
Gives same output as Standard Foundation for the same test values.