mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 02:31:39 +00:00
[Feature] Checks for Nullable strings (#6050)
* Allows null strings in createString method c# * Adds nullable strings to JS and swift * Changes js checks * Fixes typo
This commit is contained in:
@@ -60,6 +60,12 @@ final class FlatBuffersTests: XCTestCase {
|
||||
XCTAssertEqual(c.name, country)
|
||||
}
|
||||
|
||||
func testWriteNullableStrings() {
|
||||
var b = FlatBufferBuilder()
|
||||
XCTAssertTrue(b.create(string: nil).isEmpty)
|
||||
XCTAssertTrue(b.createShared(string: nil).isEmpty)
|
||||
}
|
||||
|
||||
func testWriteOptionalValues() {
|
||||
var b = FlatBufferBuilder()
|
||||
let root = optional_scalars_ScalarStuff.createScalarStuff(&b,
|
||||
@@ -74,7 +80,6 @@ final class FlatBuffersTests: XCTestCase {
|
||||
XCTAssertEqual(scalarTable.defaultI8, 42)
|
||||
XCTAssertEqual(scalarTable.justU8, 100)
|
||||
XCTAssertEqual(scalarTable.maybeU8, 10)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user