refactor: Don't destructure the Deno namespace (#6268)

This commit is contained in:
Nayeem Rahman 2020-06-12 20:23:38 +01:00 committed by GitHub
parent 26bf56afda
commit 1fff6f55c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 1632 additions and 1695 deletions

View file

@ -1,15 +1,14 @@
import diff from "./diff.ts";
import { assertEquals } from "../testing/asserts.ts";
const { test } = Deno;
test({
Deno.test({
name: "empty",
fn(): void {
assertEquals(diff([], []), []);
},
});
test({
Deno.test({
name: '"a" vs "b"',
fn(): void {
assertEquals(diff(["a"], ["b"]), [
@ -19,28 +18,28 @@ test({
},
});
test({
Deno.test({
name: '"a" vs "a"',
fn(): void {
assertEquals(diff(["a"], ["a"]), [{ type: "common", value: "a" }]);
},
});
test({
Deno.test({
name: '"a" vs ""',
fn(): void {
assertEquals(diff(["a"], []), [{ type: "removed", value: "a" }]);
},
});
test({
Deno.test({
name: '"" vs "a"',
fn(): void {
assertEquals(diff([], ["a"]), [{ type: "added", value: "a" }]);
},
});
test({
Deno.test({
name: '"a" vs "a, b"',
fn(): void {
assertEquals(diff(["a"], ["a", "b"]), [
@ -50,7 +49,7 @@ test({
},
});
test({
Deno.test({
name: '"strength" vs "string"',
fn(): void {
assertEquals(diff(Array.from("strength"), Array.from("string")), [
@ -67,7 +66,7 @@ test({
},
});
test({
Deno.test({
name: '"strength" vs ""',
fn(): void {
assertEquals(diff(Array.from("strength"), Array.from("")), [
@ -83,7 +82,7 @@ test({
},
});
test({
Deno.test({
name: '"" vs "strength"',
fn(): void {
assertEquals(diff(Array.from(""), Array.from("strength")), [
@ -99,7 +98,7 @@ test({
},
});
test({
Deno.test({
name: '"abc", "c" vs "abc", "bcd", "c"',
fn(): void {
assertEquals(diff(["abc", "c"], ["abc", "bcd", "c"]), [