From 82655b928500ca7a9762617b1c61f80fd122ccbd Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Tue, 21 Jun 2022 06:46:59 +0300 Subject: perf(ext/ffi): Optimize FFI Rust side type checks (#14923) --- test_ffi/tests/integration_tests.rs | 1 + test_ffi/tests/test.js | 3 +++ 2 files changed, 4 insertions(+) (limited to 'test_ffi/tests') 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); -- cgit v1.2.3