summaryrefslogtreecommitdiff
path: root/test_plugin/tests
diff options
context:
space:
mode:
authorValentin Anger <syrupthinker@gryphno.de>2020-06-01 20:20:47 +0200
committerGitHub <noreply@github.com>2020-06-01 14:20:47 -0400
commitbecbb56b19e96e4dd72b861217a855fba953d290 (patch)
treed9e99771c537ef87a4a945f0120775c337ef90aa /test_plugin/tests
parent12d741c2fe453625d510313beaa2e1c282784c00 (diff)
feat(core): Ops can take several zero copy buffers (#4788)
Diffstat (limited to 'test_plugin/tests')
-rw-r--r--test_plugin/tests/integration_tests.rs2
-rw-r--r--test_plugin/tests/test.js13
2 files changed, 10 insertions, 5 deletions
diff --git a/test_plugin/tests/integration_tests.rs b/test_plugin/tests/integration_tests.rs
index 17002fc01..8716048b1 100644
--- a/test_plugin/tests/integration_tests.rs
+++ b/test_plugin/tests/integration_tests.rs
@@ -57,7 +57,7 @@ fn basic() {
println!("stderr {}", stderr);
}
assert!(output.status.success());
- let expected = "Hello from plugin. data: test | zero_copy: test\nPlugin Sync Response: test\nHello from plugin. data: test | zero_copy: test\nPlugin Async Response: test\n";
+ let expected = "Hello from plugin. data: test\nzero_copy[0]: test\nzero_copy[1]: 123\nzero_copy[2]: cba\nPlugin Sync Response: test\nHello from plugin. data: test\nzero_copy[0]: test\nzero_copy[1]: 123\nPlugin Async Response: test\n";
assert_eq!(stdout, expected);
assert_eq!(stderr, "");
}
diff --git a/test_plugin/tests/test.js b/test_plugin/tests/test.js
index 8d6146902..fbe58aeb8 100644
--- a/test_plugin/tests/test.js
+++ b/test_plugin/tests/test.js
@@ -33,7 +33,9 @@ function runTestSync() {
const response = Deno.core.dispatch(
testSync,
new Uint8Array([116, 101, 115, 116]),
- new Uint8Array([116, 101, 115, 116])
+ new Uint8Array([116, 101, 115, 116]),
+ new Uint8Array([49, 50, 51]),
+ new Uint8Array([99, 98, 97])
);
console.log(`Plugin Sync Response: ${textDecoder.decode(response)}`);
@@ -47,7 +49,8 @@ function runTestAsync() {
const response = Deno.core.dispatch(
testAsync,
new Uint8Array([116, 101, 115, 116]),
- new Uint8Array([116, 101, 115, 116])
+ new Uint8Array([116, 101, 115, 116]),
+ new Uint8Array([49, 50, 51])
);
if (response != null || response != undefined) {
@@ -80,9 +83,11 @@ function runTestPluginClose() {
const preStr = JSON.stringify(resourcesPre, null, 2);
const postStr = JSON.stringify(resourcesPost, null, 2);
if (preStr !== postStr) {
- throw new Error(`Difference in open resources before openPlugin and after Plugin.close():
+ throw new Error(
+ `Difference in open resources before openPlugin and after Plugin.close():
Before: ${preStr}
-After: ${postStr}`);
+After: ${postStr}`
+ );
}
}