summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/ops_test.ts2
-rw-r--r--cli/tests/unit/text_encoding_test.ts28
2 files changed, 3 insertions, 27 deletions
diff --git a/cli/tests/unit/ops_test.ts b/cli/tests/unit/ops_test.ts
index 1b7377dc5..ae225c78d 100644
--- a/cli/tests/unit/ops_test.ts
+++ b/cli/tests/unit/ops_test.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-const EXPECTED_OP_COUNT = 49;
+const EXPECTED_OP_COUNT = 45;
Deno.test(function checkExposedOps() {
// @ts-ignore TS doesn't allow to index with symbol
diff --git a/cli/tests/unit/text_encoding_test.ts b/cli/tests/unit/text_encoding_test.ts
index 24dd35aa3..719e5907e 100644
--- a/cli/tests/unit/text_encoding_test.ts
+++ b/cli/tests/unit/text_encoding_test.ts
@@ -270,7 +270,7 @@ Deno.test(function textEncoderShouldCoerceToString() {
Deno.test(function binaryEncode() {
// @ts-ignore: Deno[Deno.internal].core allowed
- const ops = Deno[Deno.internal].core.ops;
+ const core = Deno[Deno.internal].core;
function asBinaryString(bytes: Uint8Array): string {
return Array.from(bytes).map(
(v: number) => String.fromCodePoint(v),
@@ -281,30 +281,6 @@ Deno.test(function binaryEncode() {
const chars: string[] = Array.from(binaryString);
return chars.map((v: string): number | undefined => v.codePointAt(0));
}
-
- // invalid utf-8 code points
- const invalid = new Uint8Array([0xC0]);
- assertEquals(
- ops.op_encode_binary_string(invalid),
- asBinaryString(invalid),
- );
-
- const invalid2 = new Uint8Array([0xC1]);
- assertEquals(
- ops.op_encode_binary_string(invalid2),
- asBinaryString(invalid2),
- );
-
- for (let i = 0, j = 255; i <= 255; i++, j--) {
- const bytes = new Uint8Array([i, j]);
- const binaryString = ops.op_encode_binary_string(bytes);
- assertEquals(
- binaryString,
- asBinaryString(bytes),
- );
- assertEquals(Array.from(bytes), decodeBinary(binaryString));
- }
-
const inputs = [
"σ😀",
"Кириллица is Cyrillic",
@@ -315,7 +291,7 @@ Deno.test(function binaryEncode() {
];
for (const input of inputs) {
const bytes = new TextEncoder().encode(input);
- const binaryString = ops.op_encode_binary_string(bytes);
+ const binaryString = core.encodeBinaryString(bytes);
assertEquals(
binaryString,
asBinaryString(bytes),