mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 21:32:18 +00:00
Kotlin test optional enum (#6201)
* Add test for optional enums in Kotlin * Rename optional_scalars2.fbs into optional_scalars.fbs Also updated all references in the project to point to "optional_scalars.fbs" instead of "optional_scalars2.fbs".
This commit is contained in:
@@ -510,6 +510,9 @@ class KotlinTest {
|
||||
assert(scalarStuff.justBool == false)
|
||||
assert(scalarStuff.maybeBool == null)
|
||||
assert(scalarStuff.defaultBool == true)
|
||||
assert(scalarStuff.justEnum == OptionalByte.None)
|
||||
assert(scalarStuff.maybeEnum == null)
|
||||
assert(scalarStuff.defaultEnum == OptionalByte.One)
|
||||
|
||||
fbb.clear()
|
||||
|
||||
@@ -547,6 +550,9 @@ class KotlinTest {
|
||||
ScalarStuff.addJustBool(fbb, true)
|
||||
ScalarStuff.addMaybeBool(fbb, true)
|
||||
ScalarStuff.addDefaultBool(fbb, true)
|
||||
ScalarStuff.addJustEnum(fbb, OptionalByte.Two)
|
||||
ScalarStuff.addMaybeEnum(fbb, OptionalByte.Two)
|
||||
ScalarStuff.addDefaultEnum(fbb, OptionalByte.Two)
|
||||
|
||||
pos = ScalarStuff.endScalarStuff(fbb)
|
||||
|
||||
@@ -587,6 +593,9 @@ class KotlinTest {
|
||||
assert(scalarStuff.justBool == true)
|
||||
assert(scalarStuff.maybeBool == true)
|
||||
assert(scalarStuff.defaultBool == true)
|
||||
assert(scalarStuff.justEnum == OptionalByte.Two)
|
||||
assert(scalarStuff.maybeEnum == OptionalByte.Two)
|
||||
assert(scalarStuff.defaultEnum == OptionalByte.Two)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user