summaryrefslogtreecommitdiff
path: root/cli/tests/unit/text_encoding_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/text_encoding_test.ts')
-rw-r--r--cli/tests/unit/text_encoding_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/unit/text_encoding_test.ts b/cli/tests/unit/text_encoding_test.ts
index 23799fba3..6a9274d02 100644
--- a/cli/tests/unit/text_encoding_test.ts
+++ b/cli/tests/unit/text_encoding_test.ts
@@ -112,6 +112,17 @@ unitTest(function textDecoderErrorEncoding(): void {
assert(didThrow);
});
+unitTest(function textDecoderHandlesNotFoundInternalDecoder() {
+ let didThrow = false;
+ try {
+ new TextDecoder("gbk");
+ } catch (e) {
+ didThrow = true;
+ assert(e instanceof RangeError);
+ }
+ assert(didThrow);
+});
+
unitTest(function textEncoder(): void {
const fixture = "𝓽𝓮𝔁𝓽";
const encoder = new TextEncoder();