Default-empty vectors of enums (#6505)

* disable clippy

* Vector of enum default

* swift and tests

* git clang format

* Rewrite enum parser checks

* Remove Voids from more_defaults

* vector enum swift

* remove vector accessor from swift

* clang format

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-04-06 07:23:45 -04:00
committed by GitHub
parent cd67261bba
commit 261cf3b204
12 changed files with 238 additions and 28 deletions

View File

@@ -12,6 +12,8 @@ fn object_defaults() {
floats: Vec::new(),
empty_string: "".to_string(),
some_string: "some".to_string(),
abcs: Vec::new(),
bools: Vec::new(),
},
)
}
@@ -21,6 +23,8 @@ fn nonpresent_values() {
let m = flatbuffers::root::<MoreDefaults>(&[0; 4]).unwrap();
assert_eq!(m.ints().len(), 0);
assert_eq!(m.floats().len(), 0);
assert_eq!(m.abcs().len(), 0);
assert_eq!(m.bools().len(), 0);
assert_eq!(m.empty_string(), "");
assert_eq!(m.some_string(), "some");
}