aboutsummaryrefslogtreecommitdiff
path: root/test/gleam_stdlib_test_helpers_ffi.mjs
diff options
context:
space:
mode:
authorinoas <mail@inoas.com>2023-01-22 17:16:11 +0100
committerLouis Pilfold <louis@lpil.uk>2023-01-23 22:11:27 +0000
commit1f7528d71cfcea41a124557e48670253d647e67f (patch)
treebb4db126f6700a348616d0d5df3efc0c7e0644b8 /test/gleam_stdlib_test_helpers_ffi.mjs
parente8eb4bdd031ea077be23f768b984c49fe21ed331 (diff)
downloadgleam_stdlib-1f7528d71cfcea41a124557e48670253d647e67f.tar.gz
gleam_stdlib-1f7528d71cfcea41a124557e48670253d647e67f.zip
copy over https://github.com/lpil/gleeunit/blob/main/src/gleeunit_ffi.mjs as ./test/gleam_stdlib_test_ffi.mjs; move functions that are not part of the verbatim copy into a separate helper
Diffstat (limited to 'test/gleam_stdlib_test_helpers_ffi.mjs')
-rwxr-xr-xtest/gleam_stdlib_test_helpers_ffi.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/gleam_stdlib_test_helpers_ffi.mjs b/test/gleam_stdlib_test_helpers_ffi.mjs
new file mode 100755
index 0000000..68922c9
--- /dev/null
+++ b/test/gleam_stdlib_test_helpers_ffi.mjs
@@ -0,0 +1,8 @@
+export function uint8array(list) {
+ let ints = list.toArray();
+ let array = new Uint8Array(ints.length);
+ for (let i = 0; i < ints.length; i++) {
+ array[i] = ints[i];
+ }
+ return array;
+}