2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-05-26 00:40:17 -04:00
|
|
|
|
2024-06-10 12:20:44 -04:00
|
|
|
import { Buffer } from "node:buffer";
|
2023-05-26 00:40:17 -04:00
|
|
|
import { assert, libSuffix } from "./common.js";
|
|
|
|
|
|
|
|
const ops = Deno[Deno.internal].core.ops;
|
|
|
|
|
|
|
|
Deno.test("ctr initialization (napi_module_register)", {
|
|
|
|
ignore: Deno.build.os == "windows",
|
|
|
|
}, function () {
|
|
|
|
const path = new URL(`./module.${libSuffix}`, import.meta.url).pathname;
|
2024-06-10 12:20:44 -04:00
|
|
|
const obj = ops.op_napi_open(path, {}, Buffer, reportError);
|
2023-05-26 00:40:17 -04:00
|
|
|
assert(obj != null);
|
|
|
|
assert(typeof obj === "object");
|
|
|
|
});
|