refactor: rewrite tests in std/ to use Deno.test (#3930)

This commit is contained in:
Bartek Iwańczuk 2020-02-11 17:24:27 +01:00 committed by GitHub
parent e0bcecee60
commit 61273085e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
94 changed files with 328 additions and 1185 deletions

View file

@ -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);