Add a test for JavaScript UTF-8 <=> UTF-16 conversion
authorEvan Wallace <evan.exe@gmail.com>
Thu, 20 Aug 2015 06:53:55 +0000 (23:53 -0700)
committerEvan Wallace <evan.exe@gmail.com>
Thu, 15 Oct 2015 04:15:57 +0000 (21:15 -0700)
commit57a6dd472f36de5e67c4df0e572570ab681d7a0e
treeb6b31599b9494574dba85f33e629519a6b1d8cb9
parent224e33ed09235628938970f6c672d6e2a69f5c6c
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.
.gitignore
tests/JavaScriptTest.js
tests/JavaScriptTest.sh
tests/unicode_test.json [new file with mode: 0644]