summaryrefslogtreecommitdiff
path: root/test_napi/strings_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test_napi/strings_test.js')
-rw-r--r--test_napi/strings_test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test_napi/strings_test.js b/test_napi/strings_test.js
new file mode 100644
index 000000000..20e95ba61
--- /dev/null
+++ b/test_napi/strings_test.js
@@ -0,0 +1,15 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+
+import { assertEquals, loadTestLibrary } from "./common.js";
+
+const strings = loadTestLibrary();
+
+Deno.test("napi string utf8", function () {
+ assertEquals(strings.test_utf8(""), "");
+ assertEquals(strings.test_utf8("🦕"), "🦕");
+});
+
+Deno.test("napi string", function () {
+ assertEquals(strings.test_utf16(""), "");
+ assertEquals(strings.test_utf16("🦕"), "🦕");
+});