-
Notifications
You must be signed in to change notification settings - Fork 238
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
Introduce bytes
type
#1543
Introduce bytes
type
#1543
Conversation
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 looks like a good start. I think I prefer just "bytes" instead of "bytestring" though. For tests you should look at, say, fixtures/coverall and add a "bytes" object to each of the types supported, and as results and args to methods/functions etc, then each language should test them too.
@mhammond I added support for Kotlin, Ruby and Swift and added tests. For Kotlin, I wasn't sure whether to use the The PR should be ready for review now. |
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.
I haven't given this a full review yet, but will do that asap.
85c71af
to
2f5cbd2
Compare
I forgot to add the bytes tests in the dictionary tests in Kotlin. Do you know why I have to use |
Because |
uniffi_bindgen/src/bindings/kotlin/templates/UByteArrayHelper.kt
Outdated
Show resolved
Hide resolved
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.
Some minimal nits regarding the tests, but otherwise this should be good to go.
This type is mapped to the native bytestring type in the various languages, i.e. - Kotlin: `UByteArray` - Python: `bytes` - Ruby: `String` with `Encoding::BINARY` - Swift: `Data` Also add tests exercising this new type. Fixes mozilla#1299. Fixes mozilla#1541.
This reflects the fact that `ByteArray` is a lot more common than `UByteArray`.
Done. |
Test failure seems unrelated. |
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.
Fantastic! It looks great, and sorry I didn't mention this before, but this really needs a changelog entry and a change to the docs
Done, I think. Did I find all the relevant places? |
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.
Thanks!
This type is mapped to the native bytestring type in the various languages, i.e.
ByteArray
bytes
String
withEncoding::BINARY
Data
Also add tests exercising this new type.
Fixes #1299.
Fixes #1541.