summaryrefslogtreecommitdiff
path: root/test_ffi/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test_ffi/tests')
-rw-r--r--test_ffi/tests/integration_tests.rs1
-rw-r--r--test_ffi/tests/test.js3
2 files changed, 4 insertions, 0 deletions
diff --git a/test_ffi/tests/integration_tests.rs b/test_ffi/tests/integration_tests.rs
index 93f368787..77bcc758e 100644
--- a/test_ffi/tests/integration_tests.rs
+++ b/test_ffi/tests/integration_tests.rs
@@ -45,6 +45,7 @@ fn basic() {
let expected = "\
something\n\
[1, 2, 3, 4, 5, 6, 7, 8]\n\
+ [4, 5, 6]\n\
[1, 2, 3, 4, 5, 6, 7, 8] [9, 10]\n\
[1, 2, 3, 4, 5, 6, 7, 8]\n\
[ 1, 2, 3, 4, 5, 6 ]\n\
diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js
index 8190b3c8e..ab31dcb83 100644
--- a/test_ffi/tests/test.js
+++ b/test_ffi/tests/test.js
@@ -174,6 +174,9 @@ dylib.symbols.printSomething();
const buffer = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
const buffer2 = new Uint8Array([9, 10]);
dylib.symbols.print_buffer(buffer, buffer.length);
+// Test subarrays
+const subarray = buffer.subarray(3);
+dylib.symbols.print_buffer(subarray, subarray.length - 2);
dylib.symbols.print_buffer2(buffer, buffer.length, buffer2, buffer2.length);
const ptr0 = dylib.symbols.return_buffer();
dylib.symbols.print_buffer(ptr0, 8);