diff options
Diffstat (limited to 'std/encoding')
-rw-r--r-- | std/encoding/base32_test.ts | 11 | ||||
-rw-r--r-- | std/encoding/csv_test.ts | 7 | ||||
-rw-r--r-- | std/encoding/hex_test.ts | 19 | ||||
-rw-r--r-- | std/encoding/toml_test.ts | 29 | ||||
-rw-r--r-- | std/encoding/yaml/parse_test.ts | 5 | ||||
-rw-r--r-- | std/encoding/yaml/stringify_test.ts | 3 |
6 files changed, 30 insertions, 44 deletions
diff --git a/std/encoding/base32_test.ts b/std/encoding/base32_test.ts index 6a8734fd0..eb51e44ab 100644 --- a/std/encoding/base32_test.ts +++ b/std/encoding/base32_test.ts @@ -1,7 +1,6 @@ // Test cases copied from https://github.com/LinusU/base32-encode/blob/master/test.js // Copyright (c) 2016-2017 Linus Unnebäck. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { test, runIfMain } from "../testing/mod.ts"; import { assertEquals, assert } from "../testing/asserts.ts"; import { encode, decode } from "./base32.ts"; @@ -87,7 +86,7 @@ const testCases = [ ] ]; -test({ +Deno.test({ name: "[encoding.base32] encode", fn(): void { for (const [bin, b32] of testCases) { @@ -96,7 +95,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.base32] decode", fn(): void { for (const [bin, b32] of testCases) { @@ -105,7 +104,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.base32] decode bad length", fn(): void { let errorCaught = false; @@ -121,7 +120,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.base32] decode bad padding", fn(): void { let errorCaught = false; @@ -134,5 +133,3 @@ test({ assert(errorCaught); } }); - -runIfMain(import.meta); diff --git a/std/encoding/csv_test.ts b/std/encoding/csv_test.ts index 6c726835e..74ba8face 100644 --- a/std/encoding/csv_test.ts +++ b/std/encoding/csv_test.ts @@ -1,6 +1,5 @@ // Test ported from Golang // https://github.com/golang/go/blob/2cc15b1/src/encoding/csv/reader_test.go -import { test, runIfMain } from "../testing/mod.ts"; import { assertEquals, assert } from "../testing/asserts.ts"; import { readMatrix, parse } from "./csv.ts"; import { StringReader } from "../io/readers.ts"; @@ -450,7 +449,7 @@ x,,, } ]; for (const t of testCases) { - test({ + Deno.test({ name: `[CSV] ${t.Name}`, async fn(): Promise<void> { let comma = ","; @@ -605,7 +604,7 @@ const parseTestCases = [ ]; for (const testCase of parseTestCases) { - test({ + Deno.test({ name: `[CSV] Parse ${testCase.name}`, async fn(): Promise<void> { const r = await parse(testCase.in, { @@ -616,5 +615,3 @@ for (const testCase of parseTestCases) { } }); } - -runIfMain(import.meta); diff --git a/std/encoding/hex_test.ts b/std/encoding/hex_test.ts index 126aa8ac4..f98fe5422 100644 --- a/std/encoding/hex_test.ts +++ b/std/encoding/hex_test.ts @@ -4,7 +4,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { test, runIfMain } from "../testing/mod.ts"; import { assertEquals, assertThrows } from "../testing/asserts.ts"; import { @@ -46,7 +45,7 @@ const errCases = [ ["ffeed", "\xff\xee", errLength()] ]; -test({ +Deno.test({ name: "[encoding.hex] encodedLen", fn(): void { assertEquals(encodedLen(0), 0); @@ -57,7 +56,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] encode", fn(): void { { @@ -92,7 +91,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] encodeToString", fn(): void { for (const [enc, dec] of testCases) { @@ -101,7 +100,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] decodedLen", fn(): void { assertEquals(decodedLen(0), 0); @@ -112,7 +111,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] decode", fn(): void { // Case for decoding uppercase hex characters, since @@ -133,7 +132,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] decodeString", fn(): void { for (const [enc, dec] of testCases) { @@ -144,7 +143,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] decode error", fn(): void { for (const [input, output, expectedErr] of errCases) { @@ -159,7 +158,7 @@ test({ } }); -test({ +Deno.test({ name: "[encoding.hex] decodeString error", fn(): void { for (const [input, output, expectedErr] of errCases) { @@ -178,5 +177,3 @@ test({ } } }); - -runIfMain(import.meta); diff --git a/std/encoding/toml_test.ts b/std/encoding/toml_test.ts index 8dab996a6..f1f89b428 100644 --- a/std/encoding/toml_test.ts +++ b/std/encoding/toml_test.ts @@ -1,5 +1,4 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { runIfMain, test } from "../testing/mod.ts"; import { assertEquals } from "../testing/asserts.ts"; import { existsSync } from "../fs/exists.ts"; import { readFileStrSync } from "../fs/read_file_str.ts"; @@ -16,7 +15,7 @@ function parseFile(filePath: string): object { return parse(strFile); } -test({ +Deno.test({ name: "[TOML] Strings", fn(): void { const expected = { @@ -38,7 +37,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] CRLF", fn(): void { const expected = { boolean: { bool1: true, bool2: false } }; @@ -47,7 +46,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Boolean", fn(): void { const expected = { boolean: { bool1: true, bool2: false } }; @@ -56,7 +55,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Integer", fn(): void { const expected = { @@ -81,7 +80,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Float", fn(): void { const expected = { @@ -107,7 +106,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Arrays", fn(): void { const expected = { @@ -124,7 +123,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Table", fn(): void { const expected = { @@ -157,7 +156,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Simple", fn(): void { const expected = { @@ -172,7 +171,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Datetime", fn(): void { const expected = { @@ -191,7 +190,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Inline Table", fn(): void { const expected = { @@ -236,7 +235,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Array of Tables", fn(): void { const expected = { @@ -251,7 +250,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Cargo", fn(): void { /* eslint-disable @typescript-eslint/camelcase */ @@ -298,7 +297,7 @@ test({ } }); -test({ +Deno.test({ name: "[TOML] Stringify", fn(): void { const src = { @@ -412,5 +411,3 @@ the = "array" assertEquals(actual, expected); } }); - -runIfMain(import.meta); diff --git a/std/encoding/yaml/parse_test.ts b/std/encoding/yaml/parse_test.ts index b7b742d61..bdcd8db62 100644 --- a/std/encoding/yaml/parse_test.ts +++ b/std/encoding/yaml/parse_test.ts @@ -4,10 +4,9 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { parse, parseAll } from "./parse.ts"; -import { test } from "../../testing/mod.ts"; import { assertEquals } from "../../testing/asserts.ts"; -test({ +Deno.test({ name: "`parse` parses single document yaml string", fn(): void { const yaml = ` @@ -24,7 +23,7 @@ test({ } }); -test({ +Deno.test({ name: "`parseAll` parses the yaml string with multiple documents", fn(): void { const yaml = ` diff --git a/std/encoding/yaml/stringify_test.ts b/std/encoding/yaml/stringify_test.ts index ceedb7a3c..941beb789 100644 --- a/std/encoding/yaml/stringify_test.ts +++ b/std/encoding/yaml/stringify_test.ts @@ -3,11 +3,10 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; import { assertEquals } from "../../testing/asserts.ts"; import { stringify } from "./stringify.ts"; -test({ +Deno.test({ name: "stringified correctly", fn(): void { const FIXTURE = { |