diff options
author | Leo K <crowlkats@toaxl.com> | 2021-08-05 13:08:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-05 13:08:58 +0200 |
commit | 3f0cf9619fce71a8898c495501df4bdb0e07e735 (patch) | |
tree | 1b8af2c832f8344f9a39f55326d576eab63f447f /cli/tests/unit/text_encoding_test.ts | |
parent | 299c7cfe54cb184e0d0c18b00a154c953b433ebf (diff) |
refactor(cli/tests): remove unnecessary void return types (#11577)
Diffstat (limited to 'cli/tests/unit/text_encoding_test.ts')
-rw-r--r-- | cli/tests/unit/text_encoding_test.ts | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/cli/tests/unit/text_encoding_test.ts b/cli/tests/unit/text_encoding_test.ts index 42c221cb2..a65a4176b 100644 --- a/cli/tests/unit/text_encoding_test.ts +++ b/cli/tests/unit/text_encoding_test.ts @@ -1,19 +1,19 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. import { assert, assertEquals, assertThrows, unitTest } from "./test_util.ts"; -unitTest(function btoaSuccess(): void { +unitTest(function btoaSuccess() { const text = "hello world"; const encoded = btoa(text); assertEquals(encoded, "aGVsbG8gd29ybGQ="); }); -unitTest(function atobSuccess(): void { +unitTest(function atobSuccess() { const encoded = "aGVsbG8gd29ybGQ="; const decoded = atob(encoded); assertEquals(decoded, "hello world"); }); -unitTest(function atobWithAsciiWhitespace(): void { +unitTest(function atobWithAsciiWhitespace() { const encodedList = [ " aGVsbG8gd29ybGQ=", " aGVsbG8gd29ybGQ=", @@ -30,7 +30,7 @@ unitTest(function atobWithAsciiWhitespace(): void { } }); -unitTest(function atobThrows(): void { +unitTest(function atobThrows() { let threw = false; try { atob("aGVsbG8gd29ybGQ=="); @@ -40,7 +40,7 @@ unitTest(function atobThrows(): void { assert(threw); }); -unitTest(function atobThrows2(): void { +unitTest(function atobThrows2() { let threw = false; try { atob("aGVsbG8gd29ybGQ==="); @@ -50,7 +50,7 @@ unitTest(function atobThrows2(): void { assert(threw); }); -unitTest(function atobThrows3(): void { +unitTest(function atobThrows3() { let threw = false; try { atob("foobar!!"); @@ -65,14 +65,14 @@ unitTest(function atobThrows3(): void { assert(threw); }); -unitTest(function btoaFailed(): void { +unitTest(function btoaFailed() { const text = "你好"; assertThrows(() => { btoa(text); }, DOMException); }); -unitTest(function textDecoder2(): void { +unitTest(function textDecoder2() { // deno-fmt-ignore const fixture = new Uint8Array([ 0xf0, 0x9d, 0x93, 0xbd, @@ -86,13 +86,13 @@ unitTest(function textDecoder2(): void { // ignoreBOM is tested through WPT -unitTest(function textDecoderASCII(): void { +unitTest(function textDecoderASCII() { const fixture = new Uint8Array([0x89, 0x95, 0x9f, 0xbf]); const decoder = new TextDecoder("ascii"); assertEquals(decoder.decode(fixture), "‰•Ÿ¿"); }); -unitTest(function textDecoderErrorEncoding(): void { +unitTest(function textDecoderErrorEncoding() { let didThrow = false; try { new TextDecoder("Foo"); @@ -103,7 +103,7 @@ unitTest(function textDecoderErrorEncoding(): void { assert(didThrow); }); -unitTest(function textEncoder(): void { +unitTest(function textEncoder() { const fixture = "𝓽𝓮𝔁𝓽"; const encoder = new TextEncoder(); // deno-fmt-ignore @@ -115,7 +115,7 @@ unitTest(function textEncoder(): void { ]); }); -unitTest(function textEncodeInto(): void { +unitTest(function textEncodeInto() { const fixture = "text"; const encoder = new TextEncoder(); const bytes = new Uint8Array(5); @@ -128,7 +128,7 @@ unitTest(function textEncodeInto(): void { ]); }); -unitTest(function textEncodeInto2(): void { +unitTest(function textEncodeInto2() { const fixture = "𝓽𝓮𝔁𝓽"; const encoder = new TextEncoder(); const bytes = new Uint8Array(17); @@ -144,7 +144,7 @@ unitTest(function textEncodeInto2(): void { ]); }); -unitTest(function textEncodeInto3(): void { +unitTest(function textEncodeInto3() { const fixture = "𝓽𝓮𝔁𝓽"; const encoder = new TextEncoder(); const bytes = new Uint8Array(5); @@ -157,7 +157,7 @@ unitTest(function textEncodeInto3(): void { ]); }); -unitTest(function loneSurrogateEncodeInto(): void { +unitTest(function loneSurrogateEncodeInto() { const fixture = "lone𝄞\ud888surrogate"; const encoder = new TextEncoder(); const bytes = new Uint8Array(20); @@ -174,7 +174,7 @@ unitTest(function loneSurrogateEncodeInto(): void { ]); }); -unitTest(function loneSurrogateEncodeInto2(): void { +unitTest(function loneSurrogateEncodeInto2() { const fixture = "\ud800"; const encoder = new TextEncoder(); const bytes = new Uint8Array(3); @@ -187,7 +187,7 @@ unitTest(function loneSurrogateEncodeInto2(): void { ]); }); -unitTest(function loneSurrogateEncodeInto3(): void { +unitTest(function loneSurrogateEncodeInto3() { const fixture = "\udc00"; const encoder = new TextEncoder(); const bytes = new Uint8Array(3); @@ -200,7 +200,7 @@ unitTest(function loneSurrogateEncodeInto3(): void { ]); }); -unitTest(function swappedSurrogatePairEncodeInto4(): void { +unitTest(function swappedSurrogatePairEncodeInto4() { const fixture = "\udc00\ud800"; const encoder = new TextEncoder(); const bytes = new Uint8Array(8); @@ -213,7 +213,7 @@ unitTest(function swappedSurrogatePairEncodeInto4(): void { ]); }); -unitTest(function textDecoderSharedUint8Array(): void { +unitTest(function textDecoderSharedUint8Array() { const ab = new SharedArrayBuffer(6); const dataView = new DataView(ab); const charCodeA = "A".charCodeAt(0); @@ -226,7 +226,7 @@ unitTest(function textDecoderSharedUint8Array(): void { assertEquals(actual, "ABCDEF"); }); -unitTest(function textDecoderSharedInt32Array(): void { +unitTest(function textDecoderSharedInt32Array() { const ab = new SharedArrayBuffer(8); const dataView = new DataView(ab); const charCodeA = "A".charCodeAt(0); @@ -239,14 +239,14 @@ unitTest(function textDecoderSharedInt32Array(): void { assertEquals(actual, "ABCDEFGH"); }); -unitTest(function toStringShouldBeWebCompatibility(): void { +unitTest(function toStringShouldBeWebCompatibility() { const encoder = new TextEncoder(); assertEquals(encoder.toString(), "[object TextEncoder]"); const decoder = new TextDecoder(); assertEquals(decoder.toString(), "[object TextDecoder]"); }); -unitTest(function textEncoderShouldCoerceToString(): void { +unitTest(function textEncoderShouldCoerceToString() { const encoder = new TextEncoder(); const fixutreText = "text"; const fixture = { |