mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 17:57:25 +00:00
Add a test for JavaScript UTF-8 <=> UTF-16 conversion
JavaScript uses UTF-16 but FlatBuffers uses UTF-8. This commit tests the code that does the conversion between the two encodings. The last entry in the array is tricky because each code point actually requires two UTF-16 code units, unlike the other examples. The current JSON output of flatc actually handles this case incorrectly (it generates invalid JSON with UTF-8 code units). The generated JavaScript code passes these tests fine, however.
This commit is contained in:
parent
224e33ed09
commit
57a6dd472f
4 changed files with 42 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
pushd "$(dirname $0)" >/dev/null
|
||||
test_dir="$(pwd)"
|
||||
node ${test_dir}/JavaScriptTest
|
||||
../flatc -b monster_test.fbs unicode_test.json
|
||||
node JavaScriptTest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue